From 5f33d5b3dc8fb954569a6cb60961132fcb423c86 Mon Sep 17 00:00:00 2001 From: "Julia.Svinareva" Date: Sat, 8 Jun 2024 14:32:38 +0300 Subject: [PATCH] [PE] Add Close Master button --- .../main/app/controller/ViewTab.js | 3 +++ .../main/app/template/Toolbar.template | 3 +++ .../main/app/view/Toolbar.js | 22 ++++++++++++++++++- apps/presentationeditor/main/locale/en.json | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/apps/presentationeditor/main/app/controller/ViewTab.js b/apps/presentationeditor/main/app/controller/ViewTab.js index 5a39cbddca..edccf5b683 100644 --- a/apps/presentationeditor/main/app/controller/ViewTab.js +++ b/apps/presentationeditor/main/app/controller/ViewTab.js @@ -115,6 +115,9 @@ define([ 'Toolbar': { 'view:compact': _.bind(function (toolbar, state) { this.view.chToolbar.setValue(!state, true); + }, this), + 'close:slide-master': _.bind(function () { + this.onChangeViewMode('normal', true); }, this) }, 'Statusbar': { diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index 35a818d65a..82c63be52a 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -140,6 +140,9 @@ +
diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index f8460d51ca..46487e1327 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -778,6 +778,18 @@ define([ }); this.slideOnlyControls.push(this.chFooters); + me.btnCloseSlideMaster = new Common.UI.Button({ + id: 'tlbtn-close-slide-master', + cls: 'btn-toolbar x-huge icon-top', + iconCls: 'toolbar__icon btn-close-master', + lock: [_set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], + caption: me.capCloseMaster, + dataHint: '1', + dataHintDirection: 'bottom', + dataHintOffset: 'small' + }); + me.slideOnlyControls.push(me.btnCloseSlideMaster); + me.btnInsertTable = new Common.UI.Button({ id: 'tlbtn-inserttable', cls: 'btn-toolbar x-huge icon-top', @@ -1353,6 +1365,7 @@ define([ _injectComponent('#slot-btn-insplaceholder', this.btnInsertPlaceholder); _injectComponent('#slot-chk-title', this.chTitle); _injectComponent('#slot-chk-footers', this.chFooters); + _injectComponent('#slot-btn-closeslidemaster', this.btnCloseSlideMaster); this.btnInsAudio && _injectComponent('#slot-btn-insaudio', this.btnInsAudio); this.btnInsVideo && _injectComponent('#slot-btn-insvideo', this.btnInsVideo); @@ -1561,6 +1574,7 @@ define([ this.btnEditHeader.updateHint(this.tipEditHeaderFooter); this.btnInsDateTime.updateHint(this.tipDateTime); this.btnInsSlideNum.updateHint(this.tipSlideNum); + this.btnCloseSlideMaster.updateHint(this.tipCloseMaster); // set menus @@ -1918,6 +1932,10 @@ define([ me.fireEvent('footers:hide', [me.chFooters, state === 'checked']); }, me)); + me.btnCloseSlideMaster.on('click', function (btn, e) { + me.fireEvent('close:slide-master', [btn, e]); + }); + /** coauthoring begin **/ this.showSynchTip = !Common.localStorage.getBool('pe-hide-synch'); @@ -2528,7 +2546,9 @@ define([ tipInsertPicturePlaceholder: 'Insert picture placeholder', tipInsertChartPlaceholder: 'Insert chart placeholder', tipInsertTablePlaceholder: 'Insert table placeholder', - tipInsertSmartArtPlaceholder: 'Insert smartArt placeholder' + tipInsertSmartArtPlaceholder: 'Insert smartArt placeholder', + capCloseMaster: 'Close Master', + tipCloseMaster: 'Close Master' } }()), PE.Views.Toolbar || {})); }); \ No newline at end of file diff --git a/apps/presentationeditor/main/locale/en.json b/apps/presentationeditor/main/locale/en.json index 6dfd5dd9fa..aedcd1e199 100644 --- a/apps/presentationeditor/main/locale/en.json +++ b/apps/presentationeditor/main/locale/en.json @@ -2806,6 +2806,8 @@ "PE.Views.Toolbar.txtObjectsAlign": "Align selected objects", "PE.Views.Toolbar.txtSlideAlign": "Align to Slide", "PE.Views.Toolbar.txtUngroup": "Ungroup", + "PE.Views.Toolbar.capCloseMaster": "Close Master", + "PE.Views.Toolbar.tipCloseMaster": "Close Master", "PE.Views.Transitions.strDelay": "Delay", "PE.Views.Transitions.strDuration": "Duration", "PE.Views.Transitions.strStartOnClick": "Start On Click",