Sortables now rely on a button
authorAlexander Ebert <ebert@woltlab.com>
Mon, 5 Mar 2012 18:55:09 +0000 (19:55 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 5 Mar 2012 18:55:09 +0000 (19:55 +0100)
wcfsetup/install/files/js/WCF.js

index e4223f95e249e8727acd710eda2c8b6655aa47ab..dcf6e67ad06e94d2fae73a29b6bdd628c5bf13ca 100644 (file)
@@ -4221,15 +4221,17 @@ WCF.Sortable.List.prototype = {
                $('#' + this._containerID + ' .wcf-sortableList').sortable({
                        connectWith: '#' + this._containerID + ' .wcf-sortableList',
                        items: 'li',
-                       placeholder: 'wcf-sortablePlaceholder',
-                       stop: $.proxy(this._save, this)
+                       placeholder: 'wcf-sortablePlaceholder'
                });
+               
+               this._container.find('.wcf-formSubmit > button[data-type="submit"]').click($.proxy(this._submit, this));
+               this._container.find('.wcf-formSubmit > button[data-type="reset"]').click($.proxy(this._reset, this));
        },
        
        /**
         * Saves object structure.
         */
-       _save: function() {
+       _submit: function() {
                // build structure
                this._container.find('.wcf-sortableList').each($.proxy(function(index, list) {
                        var $list = $(list);
@@ -4259,6 +4261,13 @@ WCF.Sortable.List.prototype = {
                this._proxy.sendRequest();
        },
        
+       /**
+        * Reloads current page.
+        */
+       _reset: function() {
+               window.location.reload(true);
+       },
+       
        /**
         * Shows notification upon success.
         *