diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 10120b3df7..4ade32a8a7 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -482,8 +482,20 @@ define([ toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this)); toolbar.btnCurrencyStyle.menu.on('item:click', _.bind(this.onNumberFormatMenu, this)); $('#id-toolbar-menu-new-bordercolor').on('click', _.bind(this.onNewBorderColor, this)); - // $('#slot-btn-paste').on('click','.dropdown-toggle', _.bind(this.onBtnPasteOptionsClick, this)); - toolbar.btnPaste.menu && toolbar.btnPaste.menu.on('show:before', _.bind(this.onBtnPasteOptionsClick, this)); + $('#slot-btn-paste').on('click', '.dropdown-toggle', _.bind(function(e) { + e.preventDefault(); + e.stopImmediatePropagation(); + + var menu = this.toolbar.btnPaste.menu; + + if (menu && menu.isVisible && menu.isVisible()) { + menu.hide(); + return; + } + + this.onBtnPasteOptionsClick(); + }, this)); + // toolbar.btnPaste.menu && toolbar.btnPaste.menu.on('show:before', _.bind(this.onBtnPasteOptionsClick, this)); toolbar.btnPageOrient.menu.on('item:click', _.bind(this.onPageOrientSelect, this)); toolbar.btnPageMargins.menu.on('item:click', _.bind(this.onPageMarginsSelect, this)); toolbar.mnuPageSize.on('item:click', _.bind(this.onPageSizeClick, this)); @@ -1079,6 +1091,7 @@ define([ }); menu.addItem(mnu) + menu.show(); return } @@ -1186,6 +1199,7 @@ define([ }); menu.addItem(mnu); } + menu.show(); } },