diff --git a/apps/common/main/lib/component/ColorButton.js b/apps/common/main/lib/component/ColorButton.js index 0de15590ce..9181a97713 100644 --- a/apps/common/main/lib/component/ColorButton.js +++ b/apps/common/main/lib/component/ColorButton.js @@ -209,8 +209,8 @@ define([ }, onEyedropperStart: function () { - this.trigger('eyedropper:start', this); Common.NotificationCenter.trigger('eyedropper:start'); + this.trigger('eyedropper:start', this); }, eyedropperEnd: function (r, g, b) { diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 6e0a318879..72e78e07a0 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -341,6 +341,7 @@ define([ toolbar.btnParagraphColor.on('color:select', _.bind(this.onParagraphColorPickerSelect, this)); toolbar.btnParagraphColor.on('eyedropper:start', _.bind(this.onEyedropperStart, this)); toolbar.btnParagraphColor.on('eyedropper:end', _.bind(this.onEyedropperEnd, this)); + this.mode.isEdit && Common.NotificationCenter.on('eyedropper:start', _.bind(this.eyedropperStart, this)); toolbar.mnuHighlightColorPicker.on('select', _.bind(this.onSelectHighlightColor, this)); toolbar.mnuHighlightTransparent.on('click', _.bind(this.onHighlightTransparentClick, this)); toolbar.mnuLineSpace.on('item:toggle', _.bind(this.onLineSpaceToggle, this)); @@ -2694,6 +2695,16 @@ define([ Common.NotificationCenter.trigger('edit:complete', this); }, + eyedropperStart: function () { + if (this.toolbar.btnCopyStyle.pressed) { + this.toolbar.btnCopyStyle.toggle(false, true); + this.api.SetPaintFormat(AscCommon.c_oAscFormatPainterState.kOff); + this.modeAlwaysSetStyle = false; + } + if (this.toolbar.btnHighlightColor.pressed) + this.toolbar.btnHighlightColor.toggle(false, true); + }, + onEyedropperStart: function (btn) { this.toolbar._isEyedropperStart = true; this.api.asc_startEyedropper(_.bind(btn.eyedropperEnd, btn)); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index db9aa15f87..48998f2931 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1695,13 +1695,6 @@ define([ me.onUpdateLastCustomMargins(); Common.NotificationCenter.on('margins:update', _.bind(me.onUpdateLastCustomMargins, me)); - - Common.NotificationCenter.on('eyedropper:start', function () { - if (me.btnCopyStyle.pressed) - me.btnCopyStyle.toggle(false, true); - if (me.btnHighlightColor.pressed) - me.btnHighlightColor.toggle(false, true); - }); } if ( me.isCompactView ) diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index 705d1dc90c..90093316e7 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -344,6 +344,7 @@ define([ toolbar.btnFontColor.on('color:select', _.bind(this.onSelectFontColor, this)); toolbar.btnFontColor.on('eyedropper:start', _.bind(this.onEyedropperStart, this)); toolbar.btnFontColor.on('eyedropper:end', _.bind(this.onEyedropperEnd, this)); + this.mode.isEdit && Common.NotificationCenter.on('eyedropper:start', _.bind(this.eyedropperStart, this)); toolbar.btnHighlightColor.on('click', _.bind(this.onBtnHighlightColor, this)); toolbar.mnuHighlightColorPicker.on('select', _.bind(this.onSelectHighlightColor, this)); toolbar.mnuHighlightTransparent.on('click', _.bind(this.onHighlightTransparentClick, this)); @@ -2861,6 +2862,16 @@ define([ } }, + eyedropperStart: function () { + if (this.toolbar.btnCopyStyle.pressed) { + this.toolbar.btnCopyStyle.toggle(false, true); + this.api.SetPaintFormat(AscCommon.c_oAscFormatPainterState.kOff); + this.modeAlwaysSetStyle = false; + } + if (this.toolbar.btnHighlightColor.pressed) + this.toolbar.btnHighlightColor.toggle(false, true); + }, + onEyedropperStart: function (btn) { this.toolbar._isEyedropperStart = true; this.api.asc_startEyedropper(_.bind(btn.eyedropperEnd, btn)); diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index ddfd2906cd..3de8e31ed3 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1226,13 +1226,6 @@ define([ if ( mode.isEdit ) { me.setTab('home'); me.processPanelVisible(); - - Common.NotificationCenter.on('eyedropper:start', function () { - if (me.btnCopyStyle.pressed) - me.btnCopyStyle.toggle(false, true); - if (me.btnHighlightColor.pressed) - me.btnHighlightColor.toggle(false, true); - }); } if ( me.isCompactView ) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 32fc0d0a0a..291c567061 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -398,6 +398,7 @@ define([ toolbar.btnBackColor.on('color:select', _.bind(this.onBackColorSelect, this)); toolbar.btnBackColor.on('eyedropper:start', _.bind(this.onEyedropperStart, this)); toolbar.btnBackColor.on('eyedropper:end', _.bind(this.onEyedropperEnd, this)); + this.mode.isEdit && Common.NotificationCenter.on('eyedropper:start', _.bind(this.eyedropperStart, this)); toolbar.btnBorders.on('click', _.bind(this.onBorders, this)); if (toolbar.btnBorders.rendered) { toolbar.btnBorders.menu.on('item:click', _.bind(this.onBordersMenu, this)); @@ -5105,6 +5106,14 @@ define([ } }, + eyedropperStart: function () { + if (this.toolbar.btnCopyStyle.pressed) { + this.toolbar.btnCopyStyle.toggle(false, true); + this.api.asc_formatPainter(AscCommon.c_oAscFormatPainterState.kOff); + this.modeAlwaysSetStyle = false; + } + }, + onEyedropperStart: function (btn) { this.toolbar._isEyedropperStart = true; this.api.asc_startEyedropper(_.bind(btn.eyedropperEnd, btn)); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index fa16da6876..0c2e9c851f 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -2259,11 +2259,6 @@ define([ } me.setTab('home'); - - Common.NotificationCenter.on('eyedropper:start', function () { - if (me.btnCopyStyle.pressed) - me.btnCopyStyle.toggle(false, true); - }); } if ( me.isCompactView ) me.setFolded(true);