From 20a45dda5f7a6aedd1f86f1ccae08f7b171e6b48 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Thu, 20 Jun 2019 14:32:10 +0300 Subject: [PATCH 1/2] Menu component: change scroll --- apps/common/main/lib/component/Menu.js | 128 ++---------------- .../main/app/view/DocumentHolder.js | 30 +--- .../main/app/view/MailMergeSettings.js | 7 - .../documenteditor/main/app/view/Statusbar.js | 9 -- apps/documenteditor/main/app/view/Toolbar.js | 17 +-- .../main/app/view/DocumentHolder.js | 21 +-- .../main/app/view/Statusbar.js | 9 -- .../main/app/view/Toolbar.js | 13 -- .../main/app/view/CellEditor.js | 6 - .../main/app/view/DocumentHolder.js | 13 -- .../main/app/view/Statusbar.js | 7 - .../main/app/view/Toolbar.js | 15 -- 12 files changed, 21 insertions(+), 254 deletions(-) diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 0ddfc79c8..24802f986 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -143,7 +143,8 @@ define([ menuAlign : 'tl-bl', menuAlignEl : null, offset : [0, 0], - cyclic : true + cyclic : true, + scrollAlwaysVisible: true }, template: _.template([ @@ -162,6 +163,7 @@ define([ this.offset = [0, 0]; this.menuAlign = this.options.menuAlign; this.menuAlignEl = this.options.menuAlignEl; + this.scrollAlwaysVisible = this.options.scrollAlwaysVisible; if (!this.options.cyclic) this.options.cls += ' no-cyclic'; @@ -243,7 +245,6 @@ define([ this.parentEl.on('hide.bs.dropdown', _.bind(me.onBeforeHideMenu, me)); this.parentEl.on('hidden.bs.dropdown', _.bind(me.onAfterHideMenu, me)); this.parentEl.on('keydown.after.bs.dropdown', _.bind(me.onAfterKeydownMenu, me)); - menuRoot.on('scroll', _.bind(me.onScroll, me)); menuRoot.hover( function(e) { me.isOver = true;}, @@ -313,64 +314,6 @@ define([ } }, - doLayout: function() { - if (this.options.maxHeight > 0) { - if (!this.rendered) { - this.mustLayout = true; - return; - } - - var me = this, - el = this.cmpEl; - - var menuRoot = (el.attr('role') === 'menu') ? el : el.find('[role=menu]'); - - if (!menuRoot.is(':visible')) { - var pos = [menuRoot.css('left'), menuRoot.css('top')]; - menuRoot.css({ - left : '-1000px', - top : '-1000px', - display : 'block' - }); - } - - var $items = menuRoot.find('li'); - - if ($items.height() * $items.length > this.options.maxHeight) { - var scroll = ''; - menuRoot.prepend(scroll); - - scroll = ''; - menuRoot.append(scroll); - - menuRoot.css({ - 'box-shadow' : 'none', - 'overflow-y' : 'hidden', - 'padding-top' : '18px' -// 'padding-bottom' : '18px' - }); - - menuRoot.find('> li:last-of-type').css('margin-bottom',18); - - var addEvent = function( elem, type, fn ) { - elem.addEventListener ? elem.addEventListener( type, fn, false ) : elem.attachEvent( "on" + type, fn ); - }; - - var eventname=(/Firefox/i.test(navigator.userAgent))? 'DOMMouseScroll' : 'mousewheel'; - addEvent(menuRoot[0], eventname, _.bind(this.onMouseWheel,this)); - menuRoot.find('.menu-scroll').on('click', _.bind(this.onScrollClick, this)); - } - - if (pos) { - menuRoot.css({ - display : '', - left : pos[0], - top : pos[1] - }); - } - } - }, - addItem: function(item) { this.insertItem(-1, item); }, @@ -405,7 +348,6 @@ define([ item.off('click').off('toggle'); item.remove(); }); - this.rendered && this.cmpEl.find('.menu-scroll').off('click').remove(); me.items = []; }, @@ -413,12 +355,17 @@ define([ onBeforeShowMenu: function(e) { Common.NotificationCenter.trigger('menu:show'); - if (this.mustLayout) { - delete this.mustLayout; - this.doLayout.call(this); + this.trigger('show:before', this, e); + + if (this.options.maxHeight && !this.scroller) { + this.scroller = new Common.UI.Scroller({ + el: $(this.el).find('.dropdown-menu '), + minScrollbarLength: 30, + suppressScrollX: true, + alwaysVisibleY: this.scrollAlwaysVisible + }); } - this.trigger('show:before', this, e); this.alignPosition(); }, @@ -439,14 +386,6 @@ define([ } } } - - if (this.$el.find('> ul > .menu-scroll').length) { - var el = this.$el.find('li .checked')[0]; - if (el) { - var offset = el.offsetTop - this.options.maxHeight / 2; - this.scrollMenu(offset < 0 ? 0 : offset); - } - } }, onBeforeHideMenu: function(e) { @@ -480,23 +419,6 @@ define([ } }, - onScroll: function(item, e) { - if (this.scroller) return; - - var menuRoot = (this.cmpEl.attr('role') === 'menu') - ? this.cmpEl - : this.cmpEl.find('[role=menu]'), - scrollTop = menuRoot.scrollTop(), - top = menuRoot.find('.menu-scroll.top'), - bottom = menuRoot.find('.menu-scroll.bottom'); - if (this.fromKeyDown) { - top.css('top', scrollTop + 'px'); - bottom.css('bottom', (-scrollTop) + 'px'); - } - top.toggleClass('disabled', scrollTop<1); - bottom.toggleClass('disabled', scrollTop + this.options.maxHeight > menuRoot[0].scrollHeight-1); - }, - onItemClick: function(item, e) { if (!item.menu) this.isOver = false; if (item.options.stopPropagation) { @@ -514,32 +436,6 @@ define([ this.trigger('item:toggle', this, item, state, e); }, - onScrollClick: function(e) { - if (/disabled/.test(e.currentTarget.className)) return false; - - this.scrollMenu(/top/.test(e.currentTarget.className)); - return false; - }, - - onMouseWheel: function(e) { - this.scrollMenu(((e.detail && -e.detail) || e.wheelDelta) > 0); - }, - - scrollMenu: function(up) { - this.fromKeyDown = false; - var menuRoot = (this.cmpEl.attr('role') === 'menu') - ? this.cmpEl - : this.cmpEl.find('[role=menu]'), - value = typeof(up)==='boolean' - ? menuRoot.scrollTop() + (up ? -20 : 20) - : up; - - menuRoot.scrollTop(value); - - menuRoot.find('.menu-scroll.top').css('top', menuRoot.scrollTop() + 'px'); - menuRoot.find('.menu-scroll.bottom').css('bottom', (-menuRoot.scrollTop()) + 'px'); - }, - setOffset: function(offsetX, offsetY) { this.offset[0] = _.isUndefined(offsetX) ? this.offset[0] : offsetX; this.offset[1] = _.isUndefined(offsetY) ? this.offset[1] : offsetY; diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index c8d8a85c3..16ed2e398 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -2711,6 +2711,7 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', + maxHeight: 300, items : [ ] }) @@ -2723,17 +2724,7 @@ define([ menuAlign: 'tl-tr', maxHeight: 300, restoreHeight: 300, - items : [ - ] - }).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: 30, - alwaysVisibleY: true - }); - } + items : [] }) }); @@ -3345,9 +3336,8 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', - style : 'max-height: 300px;', - items: [ - ] + maxHeight: 300, + items: [] }) }); @@ -3358,17 +3348,7 @@ define([ menuAlign: 'tl-tr', maxHeight: 300, restoreHeight: 300, - items : [ - ] - }).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: 30, - alwaysVisibleY: true - }); - } + items : [] }) }); diff --git a/apps/documenteditor/main/app/view/MailMergeSettings.js b/apps/documenteditor/main/app/view/MailMergeSettings.js index 85fc0adc7..90b5d27d0 100644 --- a/apps/documenteditor/main/app/view/MailMergeSettings.js +++ b/apps/documenteditor/main/app/view/MailMergeSettings.js @@ -101,13 +101,6 @@ define([ style: 'min-width: 190px;max-width: 400px;', maxHeight: 200, items: [] - }).on('render:after', function(mnu) { - this.scroller = new Common.UI.Scroller({ - el: this.$el.find('.dropdown-menu'), - useKeyboard: this.enableKeyEvents && !this.handleSelect, - suppressScrollX: true, - minScrollbarLength : 40 - }); }) }); this.btnInsField.render( $('#mmerge-btn-ins-field',me.$el)) ; diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index 76787407c..c08554ab3 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -240,15 +240,6 @@ define([ '' ].join('')), menuAlign: 'bl-tl' - }).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: 30, - alwaysVisibleY: true - }); - } }); this.zoomMenu = new Common.UI.Menu({ diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index b6a2538e2..e2d51909d 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -827,6 +827,8 @@ define([ iconCls: 'btn-pagesize', caption: me.capBtnPageSize, menu: new Common.UI.Menu({ + maxHeight: 571, + restoreHeight: 571, items: [ { caption: 'US Letter', @@ -963,15 +965,6 @@ define([ items: [], maxHeight: 560, restoreHeight: 560 - }).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 - }); - } }) }); this.toolbarControls.push(this.btnColorSchemas); @@ -2080,12 +2073,6 @@ define([ this.mnuColorSchema = new Common.UI.Menu({ maxHeight: 560, restoreHeight: 560 - }).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 = []; diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index a2769cc88..2d2544495 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -2147,6 +2147,7 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', + maxHeight: 300, items : [ ] }) @@ -2161,15 +2162,6 @@ define([ restoreHeight: 300, items : [ ] - }).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: 30, - alwaysVisibleY: true - }); - } }) }); @@ -2224,7 +2216,7 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', - style : 'max-height: 300px;', + maxHeight: 300, items: [ ] }) @@ -2239,15 +2231,6 @@ define([ restoreHeight: 300, items : [ ] - }).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: 30, - alwaysVisibleY: true - }); - } }) }); diff --git a/apps/presentationeditor/main/app/view/Statusbar.js b/apps/presentationeditor/main/app/view/Statusbar.js index d40f227f9..344cf87f9 100644 --- a/apps/presentationeditor/main/app/view/Statusbar.js +++ b/apps/presentationeditor/main/app/view/Statusbar.js @@ -274,15 +274,6 @@ define([ '' ].join('')), menuAlign: 'bl-tl' - }).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: 30, - alwaysVisibleY: true - }); - } }); this.btnLanguage = new Common.UI.Button({ diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 85648a5a6..8992763e9 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -580,13 +580,6 @@ define([ items: [], maxHeight: 560, restoreHeight: 560 - }).on('show:before', function (mnu) { - this.scroller = new Common.UI.Scroller({ - el: $(this.el).find('.dropdown-menu '), - useKeyboard: this.enableKeyEvents && !this.handleSelect, - minScrollbarLength: 40, - alwaysVisibleY: true - }); }) }); me.slideOnlyControls.push(me.btnColorSchemas); @@ -1277,12 +1270,6 @@ define([ mnuColorSchema = new Common.UI.Menu({ maxHeight: 560, restoreHeight: 560 - }).on('render:after', function (mnu) { - this.scroller = new Common.UI.Scroller({ - el: $(this.el).find('.dropdown-menu '), - useKeyboard: this.enableKeyEvents && !this.handleSelect, - minScrollbarLength: 40 - }); }); } mnuColorSchema.items = []; diff --git a/apps/spreadsheeteditor/main/app/view/CellEditor.js b/apps/spreadsheeteditor/main/app/view/CellEditor.js index 417d0c810..a1bd038ff 100644 --- a/apps/spreadsheeteditor/main/app/view/CellEditor.js +++ b/apps/spreadsheeteditor/main/app/view/CellEditor.js @@ -62,12 +62,6 @@ define([ { caption: this.textManager, value: 'manager' }, { caption: '--' } ] - }).on('render:after', function(mnu) { - this.scroller = new Common.UI.Scroller({ - el: $(this.el).find('.dropdown-menu '), - useKeyboard: this.enableKeyEvents && !this.handleSelect, - minScrollbarLength : 40 - }); }).on('show:after', function () { this.scroller.update({alwaysVisibleY: true}); }) diff --git a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js index aefbbf1c2..5f723028e 100644 --- a/apps/spreadsheeteditor/main/app/view/DocumentHolder.js +++ b/apps/spreadsheeteditor/main/app/view/DocumentHolder.js @@ -926,13 +926,6 @@ define([ maxHeight: 200, cyclic: false, items: [] - }).on('render:after', function(mnu) { - 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 () { this.scroller.update({alwaysVisibleY: true}); }); @@ -943,12 +936,6 @@ define([ items: [] }).on('render:after', function(mnu) { mnu.cmpEl.removeAttr('oo_editor_input').attr('oo_editor_keyboard', true); - this.scroller = new Common.UI.Scroller({ - el: $(this.el).find('.dropdown-menu '), - useKeyboard: this.enableKeyEvents && !this.handleSelect, - minScrollbarLength : 40, - alwaysVisibleY: true - }); }); me.fireEvent('createdelayedelements', [me]); diff --git a/apps/spreadsheeteditor/main/app/view/Statusbar.js b/apps/spreadsheeteditor/main/app/view/Statusbar.js index 82adf6b4e..5f93bd61d 100644 --- a/apps/spreadsheeteditor/main/app/view/Statusbar.js +++ b/apps/spreadsheeteditor/main/app/view/Statusbar.js @@ -201,13 +201,6 @@ define([ var menuHiddenItems = new Common.UI.Menu({ maxHeight: 260, menuAlign: 'tl-tr' - }).on('render:after', function(mnu) { - 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 () { this.scroller.update({alwaysVisibleY: true}); }); diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index a2bb10e46..08df0a83f 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1007,15 +1007,6 @@ define([ items: [], maxHeight : 560, restoreHeight: 560 - }).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 - }); - } }) }); @@ -1925,12 +1916,6 @@ define([ if (this.mnuColorSchema == null) { this.mnuColorSchema = new Common.UI.Menu({maxHeight : 560, restoreHeight: 560 - }).on('show:before', function(mnu) { - this.scroller = new Common.UI.Scroller({ - el: $(this.el).find('.dropdown-menu '), - useKeyboard: this.enableKeyEvents && !this.handleSelect, - minScrollbarLength : 40 - }); }); } From 15aac51ab47e41b27adbec634ec58f32d9bb182b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 21 Jun 2019 10:46:00 +0300 Subject: [PATCH 2/2] Menu component: refactoring, adjust menu to browser height --- apps/common/main/lib/component/Menu.js | 46 +++++++++++-------- .../main/app/view/DocumentHolder.js | 6 +-- .../documenteditor/main/app/view/Statusbar.js | 1 - apps/documenteditor/main/app/view/Toolbar.js | 9 ++-- .../main/app/view/DocumentHolder.js | 6 +-- .../main/app/view/Statusbar.js | 1 - .../main/app/view/Toolbar.js | 6 +-- .../main/app/view/Toolbar.js | 8 ++-- 8 files changed, 41 insertions(+), 42 deletions(-) diff --git a/apps/common/main/lib/component/Menu.js b/apps/common/main/lib/component/Menu.js index 24802f986..73cc749a6 100644 --- a/apps/common/main/lib/component/Menu.js +++ b/apps/common/main/lib/component/Menu.js @@ -76,6 +76,11 @@ * Arrow of the {Common.UI.MenuItem} menu items * * + * @property {Boolean/Number} restoreHeight + * + * Adjust to the browser height and restore to restoreHeight when it's Number + * + * */ if (Common === undefined) @@ -165,6 +170,11 @@ define([ this.menuAlignEl = this.options.menuAlignEl; this.scrollAlwaysVisible = this.options.scrollAlwaysVisible; + if (this.options.restoreHeight) { + this.options.restoreHeight = (typeof (this.options.restoreHeight) == "number") ? this.options.restoreHeight : (this.options.maxHeight ? this.options.maxHeight : 100000); + !this.options.maxHeight && (this.options.maxHeight = this.options.restoreHeight); + } + if (!this.options.cyclic) this.options.cls += ' no-cyclic'; _.each(this.options.items, function(item) { @@ -230,8 +240,17 @@ define([ }); } + if (this.options.maxHeight) { + menuRoot.css({'max-height': me.options.maxHeight}); + this.scroller = new Common.UI.Scroller({ + el: $(this.el).find('.dropdown-menu '), + minScrollbarLength: 30, + suppressScrollX: true, + alwaysVisibleY: this.scrollAlwaysVisible + }); + } + menuRoot.css({ - 'max-height': me.options.maxHeight||'none', position : 'fixed', right : 'auto', left : -1000, @@ -354,27 +373,14 @@ define([ onBeforeShowMenu: function(e) { Common.NotificationCenter.trigger('menu:show'); - this.trigger('show:before', this, e); - - if (this.options.maxHeight && !this.scroller) { - this.scroller = new Common.UI.Scroller({ - el: $(this.el).find('.dropdown-menu '), - minScrollbarLength: 30, - suppressScrollX: true, - alwaysVisibleY: this.scrollAlwaysVisible - }); - } - this.alignPosition(); }, onAfterShowMenu: function(e) { this.trigger('show:after', this, e); if (this.scroller) { - if (this.options.restoreHeight) - this.scroller.update(); - + this.scroller.update(); var menuRoot = (this.cmpEl.attr('role') === 'menu') ? this.cmpEl : this.cmpEl.find('[role=menu]'), $selected = menuRoot.find('> li .checked'); if ($selected.length) { @@ -486,10 +492,14 @@ define([ if (typeof (this.options.restoreHeight) == "number") { if (top + menuH > docH) { menuRoot.css('max-height', (docH - top) + 'px'); - menuH = menuRoot.outerHeight(); - } else if ( top + menuH < docH && menuRoot.height() < this.options.restoreHeight ) { + (!this.scroller) && (this.scroller = new Common.UI.Scroller({ + el: $(this.el).find('.dropdown-menu '), + minScrollbarLength: 30, + suppressScrollX: true, + alwaysVisibleY: this.scrollAlwaysVisible + })); + } else if ( top + menuH < docH && menuRoot.height() < this.options.restoreHeight) { menuRoot.css('max-height', (Math.min(docH - top, this.options.restoreHeight)) + 'px'); - menuH = menuRoot.outerHeight(); } } } else { diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 16ed2e398..a89030186 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -2711,7 +2711,7 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', - maxHeight: 300, + restoreHeight: true, items : [ ] }) @@ -2722,7 +2722,6 @@ define([ menu : new Common.UI.Menu({ cls: 'lang-menu', menuAlign: 'tl-tr', - maxHeight: 300, restoreHeight: 300, items : [] }) @@ -3336,7 +3335,7 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', - maxHeight: 300, + restoreHeight: true, items: [] }) }); @@ -3346,7 +3345,6 @@ define([ menu : new Common.UI.Menu({ cls: 'lang-menu', menuAlign: 'tl-tr', - maxHeight: 300, restoreHeight: 300, items : [] }) diff --git a/apps/documenteditor/main/app/view/Statusbar.js b/apps/documenteditor/main/app/view/Statusbar.js index c08554ab3..e16c53e35 100644 --- a/apps/documenteditor/main/app/view/Statusbar.js +++ b/apps/documenteditor/main/app/view/Statusbar.js @@ -231,7 +231,6 @@ define([ this.langMenu = new Common.UI.Menu({ cls: 'lang-menu', style: 'margin-top:-5px;', - maxHeight: 300, restoreHeight: 300, itemTemplate: _.template([ '', diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index e2d51909d..ccb569908 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -827,8 +827,7 @@ define([ iconCls: 'btn-pagesize', caption: me.capBtnPageSize, menu: new Common.UI.Menu({ - maxHeight: 571, - restoreHeight: 571, + restoreHeight: true, items: [ { caption: 'US Letter', @@ -963,8 +962,7 @@ define([ iconCls: 'btn-colorschemas', menu: new Common.UI.Menu({ items: [], - maxHeight: 560, - restoreHeight: 560 + restoreHeight: true }) }); this.toolbarControls.push(this.btnColorSchemas); @@ -2071,8 +2069,7 @@ define([ if (this.mnuColorSchema == null) { this.mnuColorSchema = new Common.UI.Menu({ - maxHeight: 560, - restoreHeight: 560 + restoreHeight: true }); } this.mnuColorSchema.items = []; diff --git a/apps/presentationeditor/main/app/view/DocumentHolder.js b/apps/presentationeditor/main/app/view/DocumentHolder.js index 2d2544495..c0eced818 100644 --- a/apps/presentationeditor/main/app/view/DocumentHolder.js +++ b/apps/presentationeditor/main/app/view/DocumentHolder.js @@ -2147,7 +2147,7 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', - maxHeight: 300, + restoreHeight: true, items : [ ] }) @@ -2158,7 +2158,6 @@ define([ menu : new Common.UI.Menu({ cls: 'lang-menu', menuAlign: 'tl-tr', - maxHeight: 300, restoreHeight: 300, items : [ ] @@ -2216,7 +2215,7 @@ define([ caption : me.moreText, menu : new Common.UI.Menu({ menuAlign: 'tl-tr', - maxHeight: 300, + restoreHeight: true, items: [ ] }) @@ -2227,7 +2226,6 @@ define([ menu : new Common.UI.Menu({ cls: 'lang-menu', menuAlign: 'tl-tr', - maxHeight: 300, restoreHeight: 300, items : [ ] diff --git a/apps/presentationeditor/main/app/view/Statusbar.js b/apps/presentationeditor/main/app/view/Statusbar.js index 344cf87f9..0dd0fbfb9 100644 --- a/apps/presentationeditor/main/app/view/Statusbar.js +++ b/apps/presentationeditor/main/app/view/Statusbar.js @@ -265,7 +265,6 @@ define([ this.langMenu = new Common.UI.Menu({ cls: 'lang-menu', style: 'margin-top:-5px;', - maxHeight: 300, restoreHeight: 300, itemTemplate: _.template([ '', diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index 8992763e9..617568a23 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -578,8 +578,7 @@ define([ lock: [_set.themeLock, _set.slideDeleted, _set.lostConnect, _set.noSlides, _set.disableOnStart], menu: new Common.UI.Menu({ items: [], - maxHeight: 560, - restoreHeight: 560 + restoreHeight: true }) }); me.slideOnlyControls.push(me.btnColorSchemas); @@ -1268,8 +1267,7 @@ define([ if (mnuColorSchema == null) { mnuColorSchema = new Common.UI.Menu({ - maxHeight: 560, - restoreHeight: 560 + restoreHeight: true }); } mnuColorSchema.items = []; diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index 08df0a83f..276a864c2 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1005,8 +1005,7 @@ define([ lock : [_set.editCell, _set.lostConnect, _set.coAuth], menu : new Common.UI.Menu({ items: [], - maxHeight : 560, - restoreHeight: 560 + restoreHeight: true }) }); @@ -1192,6 +1191,7 @@ define([ caption: me.capBtnPageSize, lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth], menu: new Common.UI.Menu({ + restoreHeight: true, items: [ { caption: 'US Letter', @@ -1914,8 +1914,8 @@ define([ } if (this.mnuColorSchema == null) { - this.mnuColorSchema = new Common.UI.Menu({maxHeight : 560, - restoreHeight: 560 + this.mnuColorSchema = new Common.UI.Menu({ + restoreHeight: true }); }