diff --git a/apps/presentationeditor/main/app/controller/RightMenu.js b/apps/presentationeditor/main/app/controller/RightMenu.js index 9d0d737db..b8b6e747f 100644 --- a/apps/presentationeditor/main/app/controller/RightMenu.js +++ b/apps/presentationeditor/main/app/controller/RightMenu.js @@ -56,6 +56,7 @@ define([ this.editMode = true; this._state = {no_slides: undefined}; this._initSettings = true; + this._priorityArr = []; this.addListeners({ 'RightMenu': { @@ -95,8 +96,15 @@ define([ this.editMode = mode.isEdit; }, - onRightMenuClick: function(menu, type, minimized) { + onRightMenuClick: function(menu, type, minimized, event) { if (!minimized && this.editMode) { + if (event) { // user click event + var idx = this._priorityArr.indexOf(type); + if (idx>=0) + this._priorityArr.splice(idx, 1); + this._priorityArr.unshift(type); + } + var panel = this._settings[type].panel; var props = this._settings[type].props; if (props && panel) @@ -191,6 +199,16 @@ define([ if (!this.rightmenu.minimizedMode || open) { var active; + if (priorityactive<0 && this._priorityArr.length>0) { + for (i=0; i-1) active = priorityactive; else if (currentactive>=0) active = currentactive; else if (lastactive>=0) active = lastactive; @@ -249,23 +267,23 @@ define([ }, onInsertTable: function() { - this._settings[Common.Utils.documentSettingsType.Table].needShow = true; + // this._settings[Common.Utils.documentSettingsType.Table].needShow = true; }, onInsertImage: function() { - this._settings[Common.Utils.documentSettingsType.Image].needShow = true; + // this._settings[Common.Utils.documentSettingsType.Image].needShow = true; }, onInsertChart: function() { - this._settings[Common.Utils.documentSettingsType.Chart].needShow = true; + // this._settings[Common.Utils.documentSettingsType.Chart].needShow = true; }, onInsertShape: function() { - this._settings[Common.Utils.documentSettingsType.Shape].needShow = true; + // this._settings[Common.Utils.documentSettingsType.Shape].needShow = true; }, onInsertTextArt: function() { - this._settings[Common.Utils.documentSettingsType.TextArt].needShow = true; + // this._settings[Common.Utils.documentSettingsType.TextArt].needShow = true; }, UpdateThemeColors: function() { diff --git a/apps/presentationeditor/main/app/view/RightMenu.js b/apps/presentationeditor/main/app/view/RightMenu.js index c38c81328..83289892e 100644 --- a/apps/presentationeditor/main/app/view/RightMenu.js +++ b/apps/presentationeditor/main/app/view/RightMenu.js @@ -258,7 +258,7 @@ define([ Common.localStorage.setItem("pe-hide-right-settings", 1); } - this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode]); + this.fireEvent('rightmenuclick', [this, btn.options.asctype, this.minimizedMode, e]); }, SetActivePane: function(type, open) {