diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index bfca59fcd..0d4b50b5b 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -451,8 +451,9 @@ define([ } $('button:first', el).toggleClass('active', select); - } else - $('[data-toggle^=dropdown]', el).toggleClass('active', select); + } else { + $('[data-toggle^=dropdown]:not(.dropdown-item)', el).toggleClass('active', select); + } el.toggleClass('active', select); }; diff --git a/apps/common/main/lib/extend/Bootstrap.js b/apps/common/main/lib/extend/Bootstrap.js index 268a0e788..ae15c934e 100755 --- a/apps/common/main/lib/extend/Bootstrap.js +++ b/apps/common/main/lib/extend/Bootstrap.js @@ -76,11 +76,12 @@ function patchDropDownKeyDown(e) { if ($this.is('.disabled, :disabled')) return; var $parent = getParent($this); - var isActive = $parent.hasClass('show') || $parent.hasClass('over'); + var $reference = $(e.currentTarget).hasClass('dropdown-item') ? $parent.parent().parent() : $parent; + var isActive = $reference.hasClass('open') || $reference.hasClass('show') || $reference.hasClass('over'); if (!isActive || (isActive && e.keyCode == 27)) { if (e.which == 27) { - $items = $('[role=menu] li.dropdown-submenu.over:visible', $parent); + $items = $('[role=menu] li.dropdown-submenu.over:visible', $reference); if ($items.length) { $items.eq($items.length-1).removeClass('over'); return false; @@ -88,14 +89,15 @@ function patchDropDownKeyDown(e) { $parent.removeClass('over'); $parent.find('> a').focus(); } else { - $parent.find('[data-toggle=dropdown]').focus(); + $reference.find('[data-toggle=dropdown]:not(.dropdown-item)').focus().click(); + return false; } } return (isActive) ? $this.click() : undefined; } // var $items = $('[role=menu] li:not(.divider):visible a', $parent) - original search function - var $items = $('> [role=menu] > li:not(.dropdown-divider):not(.disabled):visible', $parent).find('> a'); + var $items = $('> [role=menu] > li:not(.dropdown-divider):not(.disabled):visible', $reference).find('> a'); if (!$items.length) return; diff --git a/apps/common/main/lib/view/ReviewChanges.js b/apps/common/main/lib/view/ReviewChanges.js index 570356601..1678cc3e3 100644 --- a/apps/common/main/lib/view/ReviewChanges.js +++ b/apps/common/main/lib/view/ReviewChanges.js @@ -243,7 +243,7 @@ define([ }); if (!this.appConfig.isRestrictedEdit) {// hide Display mode option for fillForms and commenting mode - var menuTemplate = _.template('
<%= caption %>
' + + var menuTemplate = _.template('
<%= caption %>
' + '<% if (options.description !== null) { %>' + '<% } %>
'); @@ -351,7 +351,7 @@ define([ (new Promise(function (accept, reject) { accept(); })).then(function(){ - var menuTemplate = _.template('
<%= caption %>
' + + var menuTemplate = _.template('
<%= caption %>
' + '<% if (options.description !== null) { %>' + '<% } %>
'); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index ab0632f4d..74d9c596f 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -256,7 +256,7 @@ define([ '', '<% }); %>', '
  • ' + me.textMoreFormats + '
  • ' + '
  • ' + me.textMoreFormats + '
  • ' ].join('')); me.cmbNumberFormat = new Common.UI.ComboBox({ @@ -824,7 +824,7 @@ define([ '', '<% }); %>', '
  • ' + me.textMoreFormats + '
  • ' + '
  • ' + me.textMoreFormats + '
  • ' ].join('')); me.cmbNumberFormat = new Common.UI.ComboBox({ @@ -1803,7 +1803,7 @@ define([ iconCls : 'menu__icon btn-border-style', // template : _.template('<%= caption %>'), menu : (function(){ - var itemTemplate = _.template('
    '); + var itemTemplate = _.template('
    '); me.mnuBorderWidth = new Common.UI.Menu({ style : 'min-width: 100px;', @@ -1831,7 +1831,7 @@ define([ id : 'id-toolbar-mnu-item-border-color', caption : this.textBordersColor, iconCls : 'mnu-icon-item mnu-border-color', - template : _.template('<%= caption %>'), + template : _.template('<%= caption %>'), menu : new Common.UI.Menu({ menuAlign : 'tl-tr', items : [