Skip to content

Commit

Permalink
[SSE] Open right pane from fill button
Browse files Browse the repository at this point in the history
  • Loading branch information
JuliaRadzhabova committed Apr 16, 2024
1 parent b11f37d commit cf01535
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 10 deletions.
8 changes: 4 additions & 4 deletions apps/common/main/lib/component/ColorButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,22 @@ define([
id: id,
cls: 'color-menu ' + (options.eyeDropper ? 'shifted-right' : 'shifted-left'),
additionalAlign: options.additionalAlign,
items: (options.additionalItems ? options.additionalItems : []).concat(auto).concat([
items: (options.additionalItemsBefore ? options.additionalItemsBefore : []).concat(auto).concat([
{ template: _.template('<div id="' + id + '-color-menu" style="width: 164px; height:' + height + '; display: inline-block;"></div>') },
{caption: '--'}
]).concat(eyedropper).concat([
{
id: id + '-color-new',
template: _.template('<a tabindex="-1" type="menuitem" style="">' + this.textNewColor + '</a>')
}
])
]).concat(options.additionalItemsAfter ? options.additionalItemsAfter : [])
});
this.initInnerMenu();
var me = this;
menu.on('show:after', function(menu) {
me.colorPicker && _.delay(function() {
me.colorPicker.showLastSelected();
!(options.additionalItems || options.auto) && me.colorPicker.focus();
!(options.additionalItemsBefore || options.auto) && me.colorPicker.focus();
}, 10);
});
return menu;
Expand All @@ -145,7 +145,7 @@ define([
initInnerMenu: function() {
if (!this.colorPicker || typeof this.menu !== 'object') return;

var index = (this.options.additionalItems || []).length + (this.options.auto ? 2 : 0);
var index = (this.options.additionalItemsBefore || []).length + (this.options.auto ? 2 : 0);
this.colorPicker.outerMenu = {menu: this.menu, index: index};
this.menu.setInnerMenu([{menu: this.colorPicker, index: index}]);
},
Expand Down
2 changes: 1 addition & 1 deletion apps/documenteditor/main/app/view/FormSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -1723,7 +1723,7 @@ define([
if (!this.btnColor) {
this.btnColor = new Common.UI.ColorButton({
parentEl: (this.$el || $(this.el)).findById('#form-color-btn'),
additionalItems: [
additionalItemsBefore: [
this.mnuNoBorder = new Common.UI.MenuItem({
style: Common.UI.isRTL() ? 'padding-right:20px;' : 'padding-left:20px;',
caption: this.textNoBorder,
Expand Down
2 changes: 1 addition & 1 deletion apps/documenteditor/main/app/view/FormsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -503,7 +503,7 @@ define([
// lock: [ _set.previewReviewMode, _set.viewFormMode, _set.lostConnect, _set.disableOnStart],
// caption : this.textHighlight,
// menu : true,
// additionalItems: [ this.mnuNoFormsColor = new Common.UI.MenuItem({
// additionalItemsBefore: [ this.mnuNoFormsColor = new Common.UI.MenuItem({
// id: 'id-toolbar-menu-no-highlight-form',
// caption: this.textNoHighlight,
// checkable: true,
Expand Down
2 changes: 1 addition & 1 deletion apps/documenteditor/main/app/view/ListSettingsDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ define([
hint : this.txtColor,
menu: true,
takeFocusOnClose: true,
additionalItems: [{
additionalItemsBefore: [{
id: 'id-dlg-bullet-text-color',
caption: this.txtLikeText,
checkable: true,
Expand Down
2 changes: 1 addition & 1 deletion apps/documenteditor/main/app/view/RoleEditDlg.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ define([

this.btnColor = new Common.UI.ColorButton({
parentEl: $window.find('#id-dlg-role-color'),
additionalItems: [ this.mnuNoFormsColor = new Common.UI.MenuItem({
additionalItemsBefore: [ this.mnuNoFormsColor = new Common.UI.MenuItem({
id: 'id-dlg-role-menu-no-highlight',
caption: this.textNoHighlight,
checkable: true,
Expand Down
5 changes: 5 additions & 0 deletions apps/spreadsheeteditor/main/app/controller/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,7 @@ define([
toolbar.btnBackColor.on('color:select', _.bind(this.onBackColorSelect, this));
toolbar.btnBackColor.on('eyedropper:start', _.bind(this.onEyedropperStart, this));
toolbar.btnBackColor.on('eyedropper:end', _.bind(this.onEyedropperEnd, this));
toolbar.mnuFormatCellFill && toolbar.mnuFormatCellFill.on('click', _.bind(this.onFormatCellFill, this));
this.mode.isEdit && Common.NotificationCenter.on('eyedropper:start', _.bind(this.eyedropperStart, this));
toolbar.btnBorders.on('click', _.bind(this.onBorders, this));
if (toolbar.btnBorders.rendered) {
Expand Down Expand Up @@ -781,6 +782,10 @@ define([
Common.component.Analytics.trackEvent('ToolBar', 'Background Color');
},

onFormatCellFill: function(picker, color) {
this.getApplication().getController('RightMenu').onRightMenuOpen(Common.Utils.documentSettingsType.Cell);
},

onNewBorderColor: function(picker, color) {
this.toolbar.btnBorders.menu.hide();
this.toolbar.btnBorders.toggle(false, true);
Expand Down
2 changes: 1 addition & 1 deletion apps/spreadsheeteditor/main/app/view/FormatRulesEditDlg.js
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ define([ 'text!spreadsheeteditor/main/app/template/FormatRulesEditDlg.template',
var combo = new Common.UI.ComboBoxDataView({
el: $('#format-rules-combo-icon-' + (i+1)),
additionalAlign: this.menuAddAlign,
additionalItems: [{ caption: this.txtNoCellIcon, checkable: true, allowDepress: false, toggleGroup: 'no-cell-icons-' + (i+1) }],
additionalItemsBefore: [{ caption: this.txtNoCellIcon, checkable: true, allowDepress: false, toggleGroup: 'no-cell-icons-' + (i+1) }],
cls: 'move-focus',
menuStyle: 'min-width: 105px;',
dataViewStyle: 'width: 217px; margin: 0 5px;',
Expand Down
7 changes: 6 additions & 1 deletion apps/spreadsheeteditor/main/app/view/Toolbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -1011,6 +1011,10 @@ define([
transparent: true,
menu: true,
eyeDropper: true,
additionalItemsAfter: config.canBrandingExt && config.customization && config.customization.rightMenu === false || !Common.UI.LayoutManager.isElementVisible('rightMenu') ? [] : [
me.mnuFormatCellFill = new Common.UI.MenuItem({
caption: me.textFormatCellFill
})],
dataHint: '1',
dataHintDirection: 'bottom',
dataHintOffset: '0, -16'
Expand Down Expand Up @@ -3775,7 +3779,8 @@ define([
txtFillNum: 'Fill',
tipReplace: 'Replace',
textCellAlign: 'Format cell alignment',
textMoreBorders: 'More borders'
textMoreBorders: 'More borders',
textFormatCellFill: 'Format cell fill'

}, SSE.Views.Toolbar || {}));
});

0 comments on commit cf01535

Please sign in to comment.