From 4cbd0ad7e2fa24c79b76dcfd9fe6aaaba70fb035 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 16 Aug 2016 13:01:23 +0300 Subject: [PATCH 1/9] In light version default value for Autosave is off. --- apps/documenteditor/main/app/controller/LeftMenu.js | 2 +- apps/documenteditor/main/app/controller/Main.js | 7 ++++--- apps/documenteditor/main/app/view/FileMenuPanels.js | 8 ++++---- apps/presentationeditor/main/app/controller/LeftMenu.js | 2 +- apps/presentationeditor/main/app/controller/Main.js | 6 +++--- apps/presentationeditor/main/app/view/FileMenuPanels.js | 8 ++++---- apps/spreadsheeteditor/main/app/controller/LeftMenu.js | 2 +- apps/spreadsheeteditor/main/app/controller/Main.js | 6 +++--- apps/spreadsheeteditor/main/app/view/FileMenuPanels.js | 8 ++++---- 9 files changed, 25 insertions(+), 24 deletions(-) diff --git a/apps/documenteditor/main/app/controller/LeftMenu.js b/apps/documenteditor/main/app/controller/LeftMenu.js index 70c36c3a5..34d676abc 100644 --- a/apps/documenteditor/main/app/controller/LeftMenu.js +++ b/apps/documenteditor/main/app/controller/LeftMenu.js @@ -274,7 +274,7 @@ define([ this.api.SetTextBoxInputMode(parseInt(value) == 1); /** coauthoring begin **/ - if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { + if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) { value = Common.localStorage.getItem("de-settings-coauthmode"); var fast_coauth = (value===null || parseInt(value) == 1); this.api.asc_SetFastCollaborative(fast_coauth); diff --git a/apps/documenteditor/main/app/controller/Main.js b/apps/documenteditor/main/app/controller/Main.js index 2e246f7bf..0e77a8f25 100644 --- a/apps/documenteditor/main/app/controller/Main.js +++ b/apps/documenteditor/main/app/controller/Main.js @@ -795,7 +795,7 @@ define([ me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1); /** coauthoring begin **/ - if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline) { + if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { value = Common.localStorage.getItem("de-settings-coauthmode"); me._state.fastCoauth = (value===null || parseInt(value) == 1); me.api.asc_SetFastCollaborative(me._state.fastCoauth); @@ -846,7 +846,8 @@ define([ if (me.appOptions.isEdit) { value = Common.localStorage.getItem("de-settings-autosave"); - value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : 1; + value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0); + me.api.asc_setAutoSaveGap(value); if (me.needToUpdateVersion) @@ -1655,7 +1656,7 @@ define([ }, applySettings: function() { - if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { + if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { var value = Common.localStorage.getItem("de-settings-coauthmode"), oldval = this._state.fastCoauth; this._state.fastCoauth = (value===null || parseInt(value) == 1); diff --git a/apps/documenteditor/main/app/view/FileMenuPanels.js b/apps/documenteditor/main/app/view/FileMenuPanels.js index f34003d4f..7ce35ea0c 100644 --- a/apps/documenteditor/main/app/view/FileMenuPanels.js +++ b/apps/documenteditor/main/app/view/FileMenuPanels.js @@ -312,7 +312,7 @@ define([ } /** coauthoring begin **/ $('tr.coauth', this.el)[mode.isEdit && mode.canCoAuthoring ? 'show' : 'hide'](); - $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline ? 'show' : 'hide'](); + $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide'](); /** coauthoring end **/ }, @@ -329,7 +329,7 @@ define([ this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0)); value = Common.localStorage.getItem("de-settings-coauthmode"); - var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline); + var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring; item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)}); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); @@ -352,7 +352,7 @@ define([ this._oldUnits = this.cmbUnit.getValue(); value = Common.localStorage.getItem("de-settings-autosave"); - this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1)); + this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1)); value = Common.localStorage.getItem("de-settings-spellcheck"); this.chSpell.setValue(value===null || parseInt(value) == 1); @@ -366,7 +366,7 @@ define([ Common.localStorage.setItem("de-settings-zoom", this.cmbZoom.getValue()); /** coauthoring begin **/ Common.localStorage.setItem("de-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0); - if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { + if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) { Common.localStorage.setItem("de-settings-coauthmode", this.cmbCoAuthMode.getValue()); Common.localStorage.setItem(this.cmbCoAuthMode.getValue() ? "de-settings-showchanges-fast" : "de-settings-showchanges-strict", this.cmbShowChanges.getValue()); } diff --git a/apps/presentationeditor/main/app/controller/LeftMenu.js b/apps/presentationeditor/main/app/controller/LeftMenu.js index e5d1f2100..133523eb8 100644 --- a/apps/presentationeditor/main/app/controller/LeftMenu.js +++ b/apps/presentationeditor/main/app/controller/LeftMenu.js @@ -210,7 +210,7 @@ define([ this.api.SetTextBoxInputMode(parseInt(value) == 1); /** coauthoring begin **/ - if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { + if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) { value = Common.localStorage.getItem("pe-settings-coauthmode"); this.api.asc_SetFastCollaborative(value===null || parseInt(value) == 1); } diff --git a/apps/presentationeditor/main/app/controller/Main.js b/apps/presentationeditor/main/app/controller/Main.js index 38e3ca3fb..736a79adf 100644 --- a/apps/presentationeditor/main/app/controller/Main.js +++ b/apps/presentationeditor/main/app/controller/Main.js @@ -591,7 +591,7 @@ define([ me.api.SetTextBoxInputMode(value!==null && parseInt(value) == 1); /** coauthoring begin **/ - if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline) { + if (me.appOptions.isEdit && me.appOptions.canLicense && !me.appOptions.isOffline && me.appOptions.canCoAuthoring) { value = Common.localStorage.getItem("pe-settings-coauthmode"); me._state.fastCoauth = (value===null || parseInt(value) == 1); } else @@ -630,7 +630,7 @@ define([ if (me.appOptions.isEdit) { value = Common.localStorage.getItem("pe-settings-autosave"); - value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : 1; + value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0); me.api.asc_setAutoSaveGap(value); if (me.needToUpdateVersion) @@ -1432,7 +1432,7 @@ define([ }, applySettings: function() { - if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { + if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { var value = Common.localStorage.getItem("pe-settings-coauthmode"), oldval = this._state.fastCoauth; this._state.fastCoauth = (value===null || parseInt(value) == 1); diff --git a/apps/presentationeditor/main/app/view/FileMenuPanels.js b/apps/presentationeditor/main/app/view/FileMenuPanels.js index 02e377579..682c1ee91 100644 --- a/apps/presentationeditor/main/app/view/FileMenuPanels.js +++ b/apps/presentationeditor/main/app/view/FileMenuPanels.js @@ -258,7 +258,7 @@ define([ this.lblAutosave.text(this.textAutoRecover); } /** coauthoring begin **/ - $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline ? 'show' : 'hide'](); + $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline && mode.canCoAuthoring ? 'show' : 'hide'](); /** coauthoring end **/ }, @@ -273,7 +273,7 @@ define([ /** coauthoring begin **/ value = Common.localStorage.getItem("pe-settings-coauthmode"); - var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline); + var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring; item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)}); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); @@ -286,7 +286,7 @@ define([ this._oldUnits = this.cmbUnit.getValue(); value = Common.localStorage.getItem("pe-settings-autosave"); - this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1)); + this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1)); value = Common.localStorage.getItem("pe-settings-showsnaplines"); this.chAlignGuides.setValue(value===null || parseInt(value) == 1); @@ -296,7 +296,7 @@ define([ Common.localStorage.setItem("pe-settings-inputmode", this.chInputMode.isChecked() ? 1 : 0); Common.localStorage.setItem("pe-settings-zoom", this.cmbZoom.getValue()); /** coauthoring begin **/ - if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { + if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) { Common.localStorage.setItem("pe-settings-coauthmode", this.cmbCoAuthMode.getValue()); } /** coauthoring end **/ diff --git a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js index 684c62ed1..715563fe1 100644 --- a/apps/spreadsheeteditor/main/app/controller/LeftMenu.js +++ b/apps/spreadsheeteditor/main/app/controller/LeftMenu.js @@ -244,7 +244,7 @@ define([ (!(value!==null && parseInt(value) == 0)) ? this.api.asc_showComments() : this.api.asc_hideComments(); // this.getApplication().getController('DocumentHolder').setLiveCommenting(!(value!==null && parseInt(value) == 0)); - if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) { + if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) { value = Common.localStorage.getItem("sse-settings-coauthmode"); this.api.asc_SetFastCollaborative(value===null || parseInt(value) == 1); } diff --git a/apps/spreadsheeteditor/main/app/controller/Main.js b/apps/spreadsheeteditor/main/app/controller/Main.js index e77850c53..0d21692ec 100644 --- a/apps/spreadsheeteditor/main/app/controller/Main.js +++ b/apps/spreadsheeteditor/main/app/controller/Main.js @@ -559,7 +559,7 @@ define([ this.isLiveCommenting = !(value!==null && parseInt(value) == 0); this.isLiveCommenting?this.api.asc_showComments():this.api.asc_hideComments(); - if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { + if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { value = Common.localStorage.getItem("sse-settings-coauthmode"); this._state.fastCoauth = (value===null || parseInt(value) == 1); } else @@ -619,7 +619,7 @@ define([ if (me.appOptions.isEdit) { if (me.appOptions.canAutosave) { value = Common.localStorage.getItem("sse-settings-autosave"); - value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : 1; + value = (!me._state.fastCoauth && value!==null) ? parseInt(value) : (me.appOptions.canCoAuthoring ? 1 : 0); } else { value = 0; } @@ -1652,7 +1652,7 @@ define([ }, applySettings: function() { - if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline) { + if (this.appOptions.isEdit && this.appOptions.canLicense && !this.appOptions.isOffline && this.appOptions.canCoAuthoring) { var value = Common.localStorage.getItem("sse-settings-coauthmode"), oldval = this._state.fastCoauth; this._state.fastCoauth = (value===null || parseInt(value) == 1); diff --git a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js index c04f92c56..477060db9 100644 --- a/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js +++ b/apps/spreadsheeteditor/main/app/view/FileMenuPanels.js @@ -651,7 +651,7 @@ define([ this.lblAutosave.text(this.textAutoRecover); } $('tr.coauth', this.el)[mode.canCoAuthoring && mode.isEdit ? 'show' : 'hide'](); - $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline ? 'show' : 'hide'](); + $('tr.coauth.changes', this.el)[mode.isEdit && mode.canLicense && !mode.isOffline && mode.canCoAuthoring? 'show' : 'hide'](); }, setApi: function(api) { @@ -668,7 +668,7 @@ define([ this.chLiveComment.setValue(!(value!==null && parseInt(value) == 0)); value = Common.localStorage.getItem("sse-settings-coauthmode"); - var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline); + var fast_coauth = (value===null || parseInt(value) == 1) && !(this.mode.isDesktopApp && this.mode.isOffline) && this.mode.canCoAuthoring; item = this.cmbCoAuthMode.store.findWhere({value: parseInt(value)}); this.cmbCoAuthMode.setValue(item ? item.get('value') : 1); @@ -685,7 +685,7 @@ define([ this._oldUnits = this.cmbUnit.getValue(); value = Common.localStorage.getItem("sse-settings-autosave"); - this.chAutosave.setValue(fast_coauth || (value===null || parseInt(value) == 1)); + this.chAutosave.setValue(fast_coauth || (value===null ? this.mode.canCoAuthoring : parseInt(value) == 1)); value = Common.localStorage.getItem("sse-settings-func-locale"); if (value===null) @@ -726,7 +726,7 @@ define([ Common.localStorage.setItem("sse-settings-zoom", this.cmbZoom.getValue()); /** coauthoring begin **/ Common.localStorage.setItem("sse-settings-livecomment", this.chLiveComment.isChecked() ? 1 : 0); - if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline) + if (this.mode.isEdit && this.mode.canLicense && !this.mode.isOffline && this.mode.canCoAuthoring) Common.localStorage.setItem("sse-settings-coauthmode", this.cmbCoAuthMode.getValue()); /** coauthoring end **/ Common.localStorage.setItem("sse-settings-fontrender", this.cmbFontRender.getValue()); From 0e0f593cdac67e555d2ac2d40550b534ebfd3602 Mon Sep 17 00:00:00 2001 From: "Alexander.Trofimov" Date: Mon, 22 Aug 2016 17:38:54 +0300 Subject: [PATCH 2/9] delete hotkey Alt+PgUp\Alt+PgDown processing -> processing in sdkjs --- .../main/app/controller/Statusbar.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Statusbar.js b/apps/spreadsheeteditor/main/app/controller/Statusbar.js index f778544c6..4b65a41f1 100644 --- a/apps/spreadsheeteditor/main/app/controller/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Statusbar.js @@ -68,20 +68,6 @@ define([ 'sheet:move': _.bind(this.moveWorksheet, this) } }); - - var me = this; - Common.util.Shortcuts.delegateShortcuts({shortcuts:{ - 'alt+pageup': function(e) { - me.moveCurrentTab(-1); - e.preventDefault(); - e.stopPropagation(); - }, - 'alt+pagedown': function(e) { - me.moveCurrentTab(1); - e.preventDefault(); - e.stopPropagation(); - } - }}); }, events: function() { From f1d781df3a7ab52faa6b717374d8614c8fa69153 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Aug 2016 09:41:53 +0300 Subject: [PATCH 3/9] [DE] Fix Bug 32974. --- apps/documenteditor/main/app/view/Statusbar.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index fcce4b3c2..4ad9c77c0 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -583,7 +583,7 @@ define([ data: this.options.languages }); - this.cmbLanguage.scroller.update({alwaysVisibleY: true}); + if (this.cmbLanguage.scroller) this.cmbLanguage.scroller.update({alwaysVisibleY: true}); this.cmbLanguage.on('selected', _.bind(this.onLangSelect, this)); this.cmbLanguage.setValue(Common.util.LanguageInfo.getLocalLanguageName(this.options.current)[0]); this.onLangSelect(this.cmbLanguage, this.cmbLanguage.getSelectedRecord()); From 9f3c4cc909d00bc3f4de1b8f110df66bd2297a47 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Aug 2016 11:25:57 +0300 Subject: [PATCH 4/9] [DE] Fix Bug 32975. --- apps/common/main/lib/component/Button.js | 2 + .../main/app/view/ParagraphSettings.js | 1 + apps/documenteditor/main/app/view/Toolbar.js | 75 +++++++++++-------- 3 files changed, 45 insertions(+), 33 deletions(-) diff --git a/apps/common/main/lib/component/Button.js b/apps/common/main/lib/component/Button.js index d6ff973a4..ad4f22674 100644 --- a/apps/common/main/lib/component/Button.js +++ b/apps/common/main/lib/component/Button.js @@ -461,6 +461,8 @@ define([ updateHint: function(hint) { this.options.hint = hint; + if (!this.rendered) return; + var cmpEl = this.cmpEl, modalParents = cmpEl.closest('.asc-window'); diff --git a/apps/documenteditor/main/app/view/ParagraphSettings.js b/apps/documenteditor/main/app/view/ParagraphSettings.js index 5f571a919..b9ce88807 100644 --- a/apps/documenteditor/main/app/view/ParagraphSettings.js +++ b/apps/documenteditor/main/app/view/ParagraphSettings.js @@ -395,6 +395,7 @@ define([ }, createDelayedElements: function() { + this.UpdateThemeColors(); this.updateMetricUnit(); }, diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 309bba1ae..24e0b79f8 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -694,7 +694,37 @@ define([ id : 'id-toolbar-btn-colorschemas', cls : 'btn-toolbar', iconCls : 'btn-colorschemas', - menu : true + menu : new Common.UI.Menu({ + items: [], + maxHeight : 600, + restoreHeight: 600 + }).on('show:before', function(mnu) { + if ( !this.scroller ) { + this.scroller = new Common.UI.Scroller({ + el: $(this.el).find('.dropdown-menu '), + useKeyboard: this.enableKeyEvents && !this.handleSelect, + minScrollbarLength: 40, + alwaysVisibleY: true + }); + } + }).on('show:after', function(btn, e) { + var mnu = $(this.el).find('.dropdown-menu '), + docH = $(document).height(), + menuH = mnu.outerHeight(), + top = parseInt(mnu.css('top')); + + if (menuH > docH) { + mnu.css('max-height', (docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5) + 'px'); + this.scroller.update({minScrollbarLength : 40}); + } else if ( mnu.height() < this.options.restoreHeight ) { + mnu.css('max-height', (Math.min(docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5, this.options.restoreHeight)) + 'px'); + menuH = mnu.outerHeight(); + if (top+menuH > docH) { + mnu.css('top', 0); + } + this.scroller.update({minScrollbarLength : 40}); + } + }) }); this.toolbarControls.push(this.btnColorSchemas); @@ -735,6 +765,7 @@ define([ this.mnuInsertTable = this.btnInsertTable.menu; this.mnuInsertImage = this.btnInsertImage.menu; this.mnuPageSize = this.btnPageSize.menu; + this.mnuColorSchema = this.btnColorSchemas.menu; // // DataView and pickers @@ -1095,6 +1126,7 @@ define([ this.btnColumns.updateHint(this.tipColumns); this.btnPageOrient.updateHint(this.tipPageOrient); this.btnPageSize.updateHint(this.tipPageSize); + this.btnPageMargins.updateHint(this.tipPageMargins); this.btnClearStyle.updateHint(this.tipClearStyle); this.btnCopyStyle.updateHint(this.tipCopyStyle + Common.Utils.String.platformKey('Ctrl+Shift+C')); this.btnColorSchemas.updateHint(this.tipColorSchemas); @@ -1541,40 +1573,17 @@ define([ }); } - if (!this.mnuColorSchema) { - this.btnColorSchemas.setMenu(new Common.UI.Menu({ - items: [], + if (this.mnuColorSchema == null) { + this.mnuColorSchema = new Common.UI.Menu({ maxHeight : 600, restoreHeight: 600 - })); - this.mnuColorSchema = this.btnColorSchemas.menu; - this.mnuColorSchema.on('show:before', function(mnu) { - if ( !this.scroller ) { - this.scroller = new Common.UI.Scroller({ - el: $(this.el).find('.dropdown-menu '), - useKeyboard: this.enableKeyEvents && !this.handleSelect, - minScrollbarLength: 40, - alwaysVisibleY: true - }); - } - }).on('show:after', function(btn, e) { - var mnu = $(this.el).find('.dropdown-menu '), - docH = Common.Utils.innerHeight(), - menuH = mnu.outerHeight(), - top = parseInt(mnu.css('top')); - - if (menuH > docH) { - mnu.css('max-height', (docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5) + 'px'); - this.scroller.update({minScrollbarLength : 40}); - } else if ( mnu.height() < this.options.restoreHeight ) { - mnu.css('max-height', (Math.min(docH - parseInt(mnu.css('padding-top')) - parseInt(mnu.css('padding-bottom'))-5, this.options.restoreHeight)) + 'px'); - menuH = mnu.outerHeight(); - if (top+menuH > docH) { - mnu.css('top', 0); - } - this.scroller.update({minScrollbarLength : 40}); - } - }) + }).on('show:before', function(mnu) { + this.scroller = new Common.UI.Scroller({ + el: $(this.el).find('.dropdown-menu '), + useKeyboard: this.enableKeyEvents && !this.handleSelect, + minScrollbarLength : 40 + }); + }); } this.mnuColorSchema.items = []; From 880fad0c9f3035cad3c1b46bbbb0a410ab051d9b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Aug 2016 11:50:19 +0300 Subject: [PATCH 5/9] [DE][SSE] Loading text arts and equations when editors are opened with compact toolbar. --- apps/documenteditor/main/app/controller/Toolbar.js | 5 ++++- apps/documenteditor/main/app/view/Toolbar.js | 5 +++++ apps/spreadsheeteditor/main/app/controller/Toolbar.js | 5 +++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 30c7ee918..6bc5b3f3b 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2189,6 +2189,8 @@ define([ }, fillEquations: function() { + if (!this.toolbar.btnInsertEquation.rendered) return; + var me = this, equationsStore = this.getApplication().getCollection('EquationGroups'); me.equationPickers = []; @@ -2380,8 +2382,9 @@ define([ }, fillTextArt: function() { - var me = this; + if (!this.toolbar.btnInsertText.rendered) return; + var me = this; if (this.toolbar.mnuTextArtPicker) { var models = this.getApplication().getCollection('Common.Collections.TextArt').models, count = this.toolbar.mnuTextArtPicker.store.length; diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 24e0b79f8..96633c18f 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1557,6 +1557,11 @@ define([ if (me.listStyles.menuPicker.store.length > 0 && listStylesVisible){ me.listStyles.fillComboView(me.listStyles.menuPicker.getSelectedRec(), true); } + + if (me.btnInsertText.rendered) + DE.getController('Toolbar').fillTextArt(); + if (me.btnInsertEquation.rendered) + DE.getController('Toolbar').fillEquations(); }, 100); } diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 71a88481b..10c576e35 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -1256,6 +1256,9 @@ define([ if (me.toolbar.listStyles.menuPicker.store.length > 0 && listStylesVisible){ me.toolbar.listStyles.fillComboView(me.toolbar.listStyles.menuPicker.getSelectedRec(), true); } + + if (me.toolbar.btnInsertText.rendered) + SSE.getController('Toolbar').fillTextArt(); }, 100); } @@ -2002,6 +2005,8 @@ define([ }, fillTextArt: function() { + if (!this.toolbar.btnInsertText.rendered) return; + var me = this; if (this.toolbar.mnuTextArtPicker) { From 3342f6e62ea15091e9482e1be0d6471030323eff Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Aug 2016 14:36:55 +0300 Subject: [PATCH 6/9] [DE desktop] Bug with editor loading. --- apps/documenteditor/main/app/controller/Toolbar.js | 3 ++- apps/documenteditor/main/app/view/Toolbar.js | 9 +++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Toolbar.js b/apps/documenteditor/main/app/controller/Toolbar.js index 6bc5b3f3b..0f6a96ba0 100644 --- a/apps/documenteditor/main/app/controller/Toolbar.js +++ b/apps/documenteditor/main/app/controller/Toolbar.js @@ -2194,7 +2194,8 @@ define([ var me = this, equationsStore = this.getApplication().getCollection('EquationGroups'); me.equationPickers = []; - + me.toolbar.btnInsertEquation.menu.removeAll(); + for (var i = 0; i < equationsStore.length; ++i) { var equationGroup = equationsStore.at(i); diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 96633c18f..064dcb8db 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1186,7 +1186,9 @@ define([ ] }) ); - + if (this.mode.isDesktopApp) + this.mnuitemHideTitleBar.hide(); + this.btnMarkers.setMenu( new Common.UI.Menu({ items: [ @@ -1511,10 +1513,9 @@ define([ } } - if (mode.isDesktopApp) { + if (mode.isDesktopApp) $('.toolbar-group-native').hide(); - this.mnuitemHideTitleBar.hide(); - } + this.btnMailRecepients.setVisible(mode.canCoAuthoring==true && mode.canUseMailMerge); this.listStylesAdditionalMenuItem.setVisible(mode.canEditStyles); }, From a3e36a3d3c838898f90c7bd456af86dd1e641e83 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Aug 2016 17:27:32 +0300 Subject: [PATCH 7/9] Don't close plugin dialog when ESC is pressed. Fix Bug 32983. --- apps/common/main/lib/component/Window.js | 5 +++-- apps/common/main/lib/view/Plugins.js | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/apps/common/main/lib/component/Window.js b/apps/common/main/lib/component/Window.js index 4459ec1bd..2025d3f26 100644 --- a/apps/common/main/lib/component/Window.js +++ b/apps/common/main/lib/component/Window.js @@ -154,7 +154,8 @@ define([ maxwidth: undefined, maxheight: undefined, minwidth: 0, - minheight: 0 + minheight: 0, + enableKeyEvents: true }; var template = '
<%= cls?" "+cls:"" %>" id="<%= id %>" style="width:<%= width %>px;">' + @@ -182,7 +183,7 @@ define([ } function _keydown(event) { - if (!this.isLocked() && this.isVisible()) { + if (!this.isLocked() && this.isVisible() && this.initConfig.enableKeyEvents) { switch (event.keyCode) { case Common.UI.Keys.ESC: if ( $('.asc-loadmask').length<1 ) { diff --git a/apps/common/main/lib/view/Plugins.js b/apps/common/main/lib/view/Plugins.js index 3289dbba2..9a360a09c 100644 --- a/apps/common/main/lib/view/Plugins.js +++ b/apps/common/main/lib/view/Plugins.js @@ -198,7 +198,8 @@ define([ var _options = {}; _.extend(_options, { cls: 'advanced-settings-dlg', - header: true + header: true, + enableKeyEvents: false }, options); var header_footer = (_options.buttons && _.size(_options.buttons)>0) ? 85 : 34; From 2c3891c2bd3a0eb8346ba80244a50cc779d5bf54 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 24 Aug 2016 11:35:32 +0300 Subject: [PATCH 8/9] [SSE] Fix Bug 32990. --- apps/spreadsheeteditor/main/app/controller/Toolbar.js | 11 ++--------- apps/spreadsheeteditor/main/app/view/Toolbar.js | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 10c576e35..21fc5848c 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -827,15 +827,8 @@ define([ }, onNumberFormat: function(btn) { - if (this.api) { - var format = btn.options.formatId; - if (btn.options.formatId == this.toolbar.ascFormatOptions.Accounting){ - var value = Common.localStorage.getItem("sse-settings-reg-settings"); - value = (value!==null) ? parseInt(value) : ((this.toolbar.mode.lang) ? parseInt(Common.util.LanguageInfo.getLocalLanguageCode(this.toolbar.mode.lang)) : 0x0409); - format = this.api.asc_getLocaleCurrency(value); - } - this.api.asc_setCellFormat(format); - } + if (this.api) + this.api.asc_setCellStyle(btn.options.styleName); Common.NotificationCenter.trigger('edit:complete', this.toolbar); Common.component.Analytics.trackEvent('ToolBar', 'Number Format'); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index c1a815423..6aaa5c58a 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -979,7 +979,7 @@ define([ iconCls : 'btn-percent-style', hint : me.tipDigStylePercent, lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth], - formatId : me.ascFormatOptions.Percent + styleName : 'Percent' }); me.btnCurrencyStyle = new Common.UI.Button({ @@ -988,7 +988,7 @@ define([ iconCls : 'btn-currency-style', hint : me.tipDigStyleAccounting, lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth], - formatId : me.ascFormatOptions.Accounting, + styleName : 'Currency', split : true, menu : new Common.UI.Menu({ style: 'min-width: 120px;', From 6d981df473599a9f47f68b71a9bf7df0d62afc42 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Wed, 24 Aug 2016 14:56:32 +0300 Subject: [PATCH 9/9] Fix Bug 32997. --- apps/common/main/lib/component/ComboBox.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/common/main/lib/component/ComboBox.js b/apps/common/main/lib/component/ComboBox.js index fbcb1b658..2687b0e23 100644 --- a/apps/common/main/lib/component/ComboBox.js +++ b/apps/common/main/lib/component/ComboBox.js @@ -312,6 +312,8 @@ define([ me._skipInputChange = true; me.cmpEl.find('ul li:first a').focus(); }, 10); + } else if (e.keyCode == Common.UI.Keys.RETURN && $(e.target).val() === me.lastValue){ + this._input.trigger('change', { reapply: true }); } else me._skipInputChange = false; }, @@ -333,7 +335,7 @@ define([ var val = $(e.target).val(), record = {}; - if (this.lastValue === val) { + if (this.lastValue === val && !(extra && extra.reapply)) { if (extra && extra.onkeydown) this.trigger('combo:blur', this, e); return;