diff --git a/apps/common/main/lib/component/Mixtbar.js b/apps/common/main/lib/component/Mixtbar.js index 9b452c354..c1e6c29f8 100644 --- a/apps/common/main/lib/component/Mixtbar.js +++ b/apps/common/main/lib/component/Mixtbar.js @@ -503,7 +503,8 @@ define([ setMoreButton: function(tab, panel) { var me = this; if (!btnsMore[tab]) { - var box = $(' +
diff --git a/apps/documenteditor/main/app/view/Toolbar.js b/apps/documenteditor/main/app/view/Toolbar.js index 4fc5381db..a294b8338 100644 --- a/apps/documenteditor/main/app/view/Toolbar.js +++ b/apps/documenteditor/main/app/view/Toolbar.js @@ -1515,11 +1515,17 @@ define([ menu.menuAlignEl = cmp.cmpEl; menu.menuAlign = 'tl-tl'; - var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - columnCount * (itemMargin + _width) - 1; + var menuWidth = columnCount * (itemMargin + _width), + buttonOffsetLeft = cmp.openButton.$el.offset().left; + // if (menuWidth>buttonOffsetLeft) + // menuWidth = Math.max(Math.floor(buttonOffsetLeft/(itemMargin + _width)), 2) * (itemMargin + _width); + if (menuWidth>Common.Utils.innerWidth()) + menuWidth = Math.max(Math.floor(Common.Utils.innerWidth()/(itemMargin + _width)), 2) * (itemMargin + _width); + var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft) - 1; menu.setOffset(Math.min(offset, 0)); menu.cmpEl.css({ - 'width': columnCount * (_width + itemMargin), + 'width': menuWidth, 'min-height': cmp.cmpEl.height() }); } diff --git a/apps/presentationeditor/main/app/controller/Toolbar.js b/apps/presentationeditor/main/app/controller/Toolbar.js index a666f5e01..7be6a9554 100644 --- a/apps/presentationeditor/main/app/controller/Toolbar.js +++ b/apps/presentationeditor/main/app/controller/Toolbar.js @@ -2606,6 +2606,7 @@ define([ me.toolbar.btnPaste.$el.detach().appendTo($box); me.toolbar.btnPaste.$el.find('button').attr('data-hint-direction', 'bottom'); me.toolbar.btnCopy.$el.removeClass('split'); + me.toolbar.processPanelVisible(null, true, true); } if ( config.isDesktopApp ) { diff --git a/apps/presentationeditor/main/app/template/Toolbar.template b/apps/presentationeditor/main/app/template/Toolbar.template index e0efc5b52..bf331e84d 100644 --- a/apps/presentationeditor/main/app/template/Toolbar.template +++ b/apps/presentationeditor/main/app/template/Toolbar.template @@ -109,6 +109,7 @@ +
@@ -127,6 +128,7 @@ +
@@ -212,6 +214,7 @@
+
@@ -222,6 +225,7 @@
+
diff --git a/apps/presentationeditor/main/app/view/Toolbar.js b/apps/presentationeditor/main/app/view/Toolbar.js index de669b96c..41ff4c21f 100644 --- a/apps/presentationeditor/main/app/view/Toolbar.js +++ b/apps/presentationeditor/main/app/view/Toolbar.js @@ -1088,11 +1088,17 @@ define([ menu.menuAlignEl = cmp.cmpEl; menu.menuAlign = 'tl-tl'; - var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - columnCount * (itemMargin + itemWidth) - 1; + var menuWidth = columnCount * (itemMargin + itemWidth), + buttonOffsetLeft = cmp.openButton.$el.offset().left; + // if (menuWidth>buttonOffsetLeft) + // menuWidth = Math.max(Math.floor(buttonOffsetLeft/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth); + if (menuWidth>Common.Utils.innerWidth()) + menuWidth = Math.max(Math.floor(Common.Utils.innerWidth()/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth); + var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft) - 1; menu.setOffset(Math.min(offset, 0)); menu.cmpEl.css({ - 'width': columnCount * (itemWidth + itemMargin), + 'width': menuWidth, 'min-height': cmp.cmpEl.height() }); } diff --git a/apps/spreadsheeteditor/main/app/controller/Toolbar.js b/apps/spreadsheeteditor/main/app/controller/Toolbar.js index 37f2b38da..d3b1d5de2 100644 --- a/apps/spreadsheeteditor/main/app/controller/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/controller/Toolbar.js @@ -4303,6 +4303,7 @@ define([ me.toolbar.btnPaste.$el.detach().appendTo($box); me.toolbar.btnPaste.$el.find('button').attr('data-hint-direction', 'bottom'); me.toolbar.btnCopy.$el.removeClass('split'); + me.toolbar.processPanelVisible(null, true, true); } var tab = {action: 'protect', caption: me.toolbar.textTabProtect, layoutname: 'toolbar-protect', dataHintTitle: 'T'}; diff --git a/apps/spreadsheeteditor/main/app/template/Toolbar.template b/apps/spreadsheeteditor/main/app/template/Toolbar.template index a2ca6ae33..7671925c2 100644 --- a/apps/spreadsheeteditor/main/app/template/Toolbar.template +++ b/apps/spreadsheeteditor/main/app/template/Toolbar.template @@ -124,6 +124,7 @@
+
diff --git a/apps/spreadsheeteditor/main/app/view/PivotTable.js b/apps/spreadsheeteditor/main/app/view/PivotTable.js index 9513fd36b..8a679fa8f 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotTable.js +++ b/apps/spreadsheeteditor/main/app/view/PivotTable.js @@ -79,6 +79,7 @@ define([ '' + '' + '' + + '' + '
' + '
' + '' + @@ -87,6 +88,7 @@ define([ '' + '
' + '
' + + '' + '
' + '
' + '
'; @@ -279,10 +281,29 @@ define([ lock : [_set.lostConnect, _set.coAuth, _set.noPivot, _set.selRangeEdit, _set.pivotLock, _set['FormatCells'], _set['PivotTables']], beforeOpenHandler: function(e) { var cmp = this, - menu = cmp.openButton.menu; + menu = cmp.openButton.menu, + columnCount = 4; + if (menu.cmpEl) { - var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - menu.cmpEl.outerWidth() - 1; + var itemEl = $(cmp.cmpEl.find('.dataview.inner .style').get(0)).parent(); + var itemMargin = 8; + var itemWidth = itemEl.is(':visible') ? parseFloat(itemEl.css('width')) : + (cmp.itemWidth + parseFloat(itemEl.css('padding-left')) + parseFloat(itemEl.css('padding-right')) + + parseFloat(itemEl.css('border-left-width')) + parseFloat(itemEl.css('border-right-width'))); + + menu.menuAlignEl = cmp.cmpEl; + menu.menuAlign = 'tl-tl'; + var menuWidth = columnCount * (itemMargin + itemWidth) + 17, // for scroller + buttonOffsetLeft = cmp.openButton.$el.offset().left; + if (menuWidth>Common.Utils.innerWidth()) + menuWidth = Math.max(Math.floor((Common.Utils.innerWidth()-17)/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth) + 17; + var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft) - 1; menu.setOffset(Math.min(offset, 0)); + + menu.cmpEl.css({ + 'width': menuWidth, + 'min-height': cmp.cmpEl.height() + }); } }, dataHint: '1', @@ -373,10 +394,6 @@ define([ this.btnPivotSubtotals.render(this.$el.find('#slot-btn-pivot-subtotals')); this.btnPivotGrandTotals.render(this.$el.find('#slot-btn-pivot-grand-totals')); this.pivotStyles.render(this.$el.find('#slot-field-pivot-styles')); - this.pivotStyles.openButton.menu.cmpEl.css({ - 'min-width': 293, - 'max-width': 293 - }); return this.$el; }, diff --git a/apps/spreadsheeteditor/main/app/view/Toolbar.js b/apps/spreadsheeteditor/main/app/view/Toolbar.js index c527f6721..429ef8dea 100644 --- a/apps/spreadsheeteditor/main/app/view/Toolbar.js +++ b/apps/spreadsheeteditor/main/app/view/Toolbar.js @@ -1330,11 +1330,17 @@ define([ menu.menuAlignEl = cmp.cmpEl; menu.menuAlign = 'tl-tl'; - var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - columnCount * (itemMargin + itemWidth) - 1; + var menuWidth = columnCount * (itemMargin + itemWidth), + buttonOffsetLeft = cmp.openButton.$el.offset().left; + // if (menuWidth>buttonOffsetLeft) + // menuWidth = Math.max(Math.floor(buttonOffsetLeft/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth); + if (menuWidth>Common.Utils.innerWidth()) + menuWidth = Math.max(Math.floor(Common.Utils.innerWidth()/(itemMargin + itemWidth)), 2) * (itemMargin + itemWidth); + var offset = cmp.cmpEl.width() - cmp.openButton.$el.width() - Math.min(menuWidth, buttonOffsetLeft) - 1; menu.setOffset(Math.min(offset, 0)); menu.cmpEl.css({ - 'width' : columnCount * (itemWidth + itemMargin), + 'width': menuWidth, 'min-height': cmp.cmpEl.height() }); } diff --git a/apps/spreadsheeteditor/main/app/view/WBProtection.js b/apps/spreadsheeteditor/main/app/view/WBProtection.js index de163aff6..8f9e7efed 100644 --- a/apps/spreadsheeteditor/main/app/view/WBProtection.js +++ b/apps/spreadsheeteditor/main/app/view/WBProtection.js @@ -53,6 +53,7 @@ define([ '' + '' + '' + + '' + '
' + '
' + '' + @@ -61,6 +62,7 @@ define([ '' + '
' + '
' + + '' + '
' + '
' + '' +