From 9f3c4cc909d00bc3f4de1b8f110df66bd2297a47 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 23 Aug 2016 11:25:57 +0300 Subject: [PATCH] [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 = [];