Allowing more freedom for WCF.Sortable.List
authorAlexander Ebert <ebert@woltlab.com>
Tue, 29 Jan 2013 14:55:50 +0000 (15:55 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Tue, 29 Jan 2013 14:55:50 +0000 (15:55 +0100)
wcfsetup/install/files/js/WCF.js

index 3101760e05624c424aee234b7b1861e760436052..d7b6b6ed252d68eadad71baa9a4aca6a1a7bf756 100755 (executable)
@@ -6060,7 +6060,16 @@ WCF.Sortable.List = Class.extend({
                }
                
                if (this._className) {
-                       this._container.find('.formSubmit > button[data-type="submit"]').click($.proxy(this._submit, this));
+                       var $formSubmit = this._container.find('.formSubmit');
+                       if (!$formSubmit.length) {
+                               $formSubmit = this._container.next('.formSubmit');
+                               if (!$formSubmit.length) {
+                                       console.debug("[WCF.Sortable.Simple] Unable to find form submit for saving, aborting.");
+                                       return;
+                               }
+                       }
+                       
+                       $formSubmit.children('button[data-type="submit"]').click($.proxy(this._submit, this));
                }
        },