diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 5bd13f68f..76614f906 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -497,6 +497,7 @@ define([ }, setMoreButton: function(tab, panel) { + var me = this; if (!btnsMore[tab]) { var box = $('
'); optsFold.$bar.append(moreContainer); @@ -734,6 +735,29 @@ define([ } }, + onMoreHide: function(btn, e) { + var moreContainer = btn.panel.parent(); + if (btn.pressed) { + btn.toggle(false, true); + } + if (moreContainer.is(':visible')) { + moreContainer.hide(); + Common.NotificationCenter.trigger('edit:complete', this.toolbar, btn); + } + }, + + onMoreShow: function(btn, e) { + var moreContainer = btn.panel.parent(), + parentxy = moreContainer.parent().offset(), + target = btn.$el, + showxy = target.offset(), + right = Common.Utils.innerWidth() - (showxy.left - parentxy.left + target.width()), + top = showxy.top - parentxy.top + target.height() + 10; + + moreContainer.css({right: right, left: 'auto', top : top}); + moreContainer.show(); + }, + hideMoreBtns: function() { for (var btn in btnsMore) { btnsMore[btn] && btnsMore[btn].toggle(false); diff --git a/apps/common/main/resources/less/toolbar.less b/apps/common/main/resources/less/toolbar.less index b62afc764..0f8be35af 100644 --- a/apps/common/main/resources/less/toolbar.less +++ b/apps/common/main/resources/less/toolbar.less @@ -204,7 +204,7 @@ background-color: @background-toolbar-ie; background-color: @background-toolbar; min-width:auto; - padding: 5px 10px 5px 0; + padding: 10px 10px 5px 0; border-radius: 0; z-index:999; .compactwidth { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index d995a5149..73bb712c6 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -364,7 +364,6 @@ define([ Common.Gateway.on('setmailmergerecipients', _.bind(this.setMailMergeRecipients, this)); $('#id-toolbar-menu-new-control-color').on('click', _.bind(this.onNewControlsColor, this)); toolbar.listStylesAdditionalMenuItem.on('click', this.onMenuSaveStyle.bind(this)); - Common.NotificationCenter.on('more:toggle', _.bind(this.onMoreToggle, this)); this.onSetupCopyStyleButton(); this.onBtnChangeState('undo:disabled', toolbar.btnUndo, toolbar.btnUndo.isDisabled()); @@ -3327,32 +3326,6 @@ define([ })).show(); }, - onMoreToggle: function(btn, state, e) { - (state) ? this.onMoreShow(btn, e) : this.onMoreHide(btn, e); - }, - - onMoreHide: function(btn, e) { - var moreContainer = btn.panel.parent(); - if (btn.pressed) { - btn.toggle(false, true); - } - if (moreContainer.is(':visible')) { - moreContainer.hide(); - Common.NotificationCenter.trigger('edit:complete', this.toolbar, btn); - } - }, - - onMoreShow: function(btn, e) { - var moreContainer = btn.panel.parent(); - var target = btn.$el, - showxy = target.offset(), - right = Common.Utils.innerWidth() - showxy.left - target.width(), - top = showxy.top + target.height(); - - moreContainer.css({right: right, left: 'auto', top : top}); - moreContainer.show(); - }, - textEmptyImgUrl : 'You need to specify image URL.', textWarning : 'Warning', textFontSizeErr : 'The entered value is incorrect.