From afa0b934d543b2447e771882a3add19599705d2d Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 4 Jul 2012 15:58:00 +0200 Subject: [PATCH] Added support for simple list sorting --- wcfsetup/install/files/js/WCF.js | 13 ++++++++++--- wcfsetup/install/files/style/sortable.less | 18 +++++++++++++----- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 3afe0ce554..b59244a99c 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -4967,8 +4967,9 @@ WCF.Sortable.List = Class.extend({ * @param string className * @param integer offset * @param object options + * @param boolean isSimpleSorting */ - init: function(containerID, className, offset, options) { + init: function(containerID, className, offset, options, isSimpleSorting) { this._containerID = $.wcfEscapeID(containerID); this._container = $('#' + this._containerID); this._className = className; @@ -4981,7 +4982,7 @@ WCF.Sortable.List = Class.extend({ // init sortable this._options = $.extend(true, { axis: 'y', - connectWith: '#' + this._containerID * ' .sortableList', + connectWith: '#' + this._containerID + ' .sortableList', disableNesting: 'sortableNoNesting', errorClass: 'sortableInvalidTarget', forcePlaceholderSize: true, @@ -4992,7 +4993,13 @@ WCF.Sortable.List = Class.extend({ tolerance: 'pointer', toleranceElement: '> span' }, options || { }); - $('#' + this._containerID + ' > .sortableList').wcfNestedSortable(this._options); + + if (isSimpleSorting) { + $('#' + this._containerID + ' .sortableList').sortable(this._options); + } + else { + $('#' + this._containerID + ' > .sortableList').wcfNestedSortable(this._options); + } this._container.find('.formSubmit > button[data-type="submit"]').click($.proxy(this._submit, this)); }, diff --git a/wcfsetup/install/files/style/sortable.less b/wcfsetup/install/files/style/sortable.less index cfd9ae6dd5..88ce9b7511 100644 --- a/wcfsetup/install/files/style/sortable.less +++ b/wcfsetup/install/files/style/sortable.less @@ -3,8 +3,8 @@ background-color: @wcfWarningBackgroundColor; border: 1px solid @wcfWarningBackgroundColor2; color: @wcfWarningColor; - margin: 3px 0; - padding: 4px; + margin: @wcfGapTiny 0; + padding: @wcfGapTiny; .borderRadius(); } @@ -19,7 +19,7 @@ .sortableList { list-style-position: outside; list-style-type: decimal; - margin-left: 21px; + margin-left: @wcfGapLarge; } .sortableNode { @@ -27,7 +27,15 @@ } .sortableNodeLabel { - border-bottom: 1px solid rgba(216, 231, 245, 1); /* todo */ - padding: 7px 7px 11px 0; + padding: @wcfGapSmall @wcfGapSmall @wcfGapSmall 0; display: block; +} + +.sortableList:not(.simpleSortableList) .sortableNodeLabel { + border-bottom: 1px solid rgba(216, 231, 245, 1); /* todo */ + padding-bottom: @wcfGapMedium; +} + +.simpleSortableList { + min-height: @wcfGapLarge; } \ No newline at end of file -- 2.20.1