From 94f19901a18dd928ecfecf20fbf6ef8661d3ce41 Mon Sep 17 00:00:00 2001 From: OVSharova Date: Thu, 14 Apr 2022 04:00:17 +0300 Subject: [PATCH] add header --- .../main/app/controller/Navigation.js | 22 +++- .../main/app/view/Navigation.js | 113 +++++++++++++++++- .../main/resources/less/navigation.less | 25 +++- 3 files changed, 150 insertions(+), 10 deletions(-) diff --git a/apps/documenteditor/main/app/controller/Navigation.js b/apps/documenteditor/main/app/controller/Navigation.js index bbb09fca9..1ce213486 100644 --- a/apps/documenteditor/main/app/controller/Navigation.js +++ b/apps/documenteditor/main/app/controller/Navigation.js @@ -114,6 +114,9 @@ define([ panelNavigation.viewNavigationList.on('item:add', _.bind(this.onItemAdd, this)); panelNavigation.navigationMenu.on('item:click', _.bind(this.onMenuItemClick, this)); panelNavigation.navigationMenu.items[11].menu.on('item:click', _.bind(this.onMenuLevelsItemClick, this)); + panelNavigation.btnSettingsMenu.on('item:click', _.bind(this.onMenuSettingsItemClick, this)); + panelNavigation.btnSettingsMenu.items[2].menu.on('item:click', _.bind(this.onMenuLevelsItemClick, this)); + panelNavigation.btnSettingsMenu.items[4].menu.on('item:click', _.bind(this.onMenuFontSizeClick, this)); var viewport = this.getApplication().getController('Viewport').getView('Viewport'); viewport.hlayout.on('layout:resizedrag', function () { @@ -241,8 +244,6 @@ define([ onMenuItemClick: function (menu, item) { if (!this._navigationObject && !this._viewerNavigationObject) return; - - var index = parseInt(menu.cmpEl.attr('data-value')); if (item.value == 'promote') { this._navigationObject.promote(index); } else if (item.value == 'demote') { @@ -261,11 +262,28 @@ define([ this.panelNavigation.viewNavigationList.collapseAll(); } }, + onMenuSettingsItemClick: function (menu, item){ + switch (item.value){ + case 'expand': + this.panelNavigation.viewNavigationList.expandAll(); + break; + case 'collapse': + this.panelNavigation.viewNavigationList.collapseAll(); + break; + case 'wrap': + this.panelNavigation.changeWrapHeadings(); + break; + } + }, onMenuLevelsItemClick: function (menu, item) { this.panelNavigation.viewNavigationList.expandToLevel(item.value-1); }, + onMenuFontSizeClick: function (menu, item){ + this.panelNavigation.changeFontSize(item.value); + }, + SetDisabled: function(state) { this._isDisabled = state; }, diff --git a/apps/documenteditor/main/app/view/Navigation.js b/apps/documenteditor/main/app/view/Navigation.js index 6bf35e380..a9a6ce818 100644 --- a/apps/documenteditor/main/app/view/Navigation.js +++ b/apps/documenteditor/main/app/view/Navigation.js @@ -49,8 +49,12 @@ define([ storeNavigation: undefined, template: _.template([ '