Added support for simple list sorting
authorAlexander Ebert <ebert@woltlab.com>
Wed, 4 Jul 2012 13:58:00 +0000 (15:58 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Wed, 4 Jul 2012 13:58:00 +0000 (15:58 +0200)
wcfsetup/install/files/js/WCF.js
wcfsetup/install/files/style/sortable.less

index 3afe0ce5542dcb44c6bb684778c623e8a76c76f8..b59244a99c7d7a8f0949846942370377da8a7457 100755 (executable)
@@ -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));
        },
index cfd9ae6dd5abf8c72d1152665bd013213d6fb736..88ce9b75114435f1c10dcd6da79a982c18500886 100644 (file)
@@ -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 {
 }
 
 .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