Improved inline editing checks
authorAlexander Ebert <ebert@woltlab.com>
Sun, 17 Jul 2016 13:12:30 +0000 (15:12 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sun, 17 Jul 2016 13:12:38 +0000 (15:12 +0200)
wcfsetup/install/files/js/WoltLab/WCF/Ui/Message/InlineEditor.js

index 236de58d4c0f28bd98a815e3028edf82052cbc09..93b531be2596bca539c3d62d83435e7e30514b70 100644 (file)
@@ -68,7 +68,7 @@ define(
                                if (button !== null) {
                                        canEdit = elDataBool(element, 'can-edit');
                                        
-                                       if (this._options.canEditInline) {
+                                       if (this._options.canEditInline || elDataBool(element, 'can-edit-inline')) {
                                                button.addEventListener(WCF_CLICK_EVENT, this._clickDropdown.bind(this, element));
                                                button.classList.add('jsDropdownEnabled');
                                                
@@ -248,6 +248,13 @@ define(
                                        else {
                                                if (objOwns(visibility, item) && visibility[item] === false) {
                                                        elHide(listItem);
+                                                       
+                                                       // check if previous item was a divider
+                                                       if (i > 0 && i + 1 === this._dropdownMenu.childElementCount) {
+                                                               if (elData(listItem.previousElementSibling, 'item') === 'divider') {
+                                                                       elHide(listItem.previousElementSibling);
+                                                               }
+                                                       }
                                                }
                                                else {
                                                        elShow(listItem);