From 04524baac7ae9f382b60733ebbd8a2f0e87c0001 Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 11 Oct 2019 16:45:31 +0300 Subject: [PATCH] [SSE] Pivot settings refactoring --- .../main/app/view/PivotSettings.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/spreadsheeteditor/main/app/view/PivotSettings.js b/apps/spreadsheeteditor/main/app/view/PivotSettings.js index 9d8c567ce..2112633e4 100644 --- a/apps/spreadsheeteditor/main/app/view/PivotSettings.js +++ b/apps/spreadsheeteditor/main/app/view/PivotSettings.js @@ -532,19 +532,21 @@ define([ }); } - this.miMoveFilter.setDisabled(type == 3); // menu for filter - this.miMoveRow.setDisabled(type == 1); // menu for row - this.miMoveColumn.setDisabled(type == 0); // menu for column - this.miMoveValues.setDisabled(type == 2); // menu for value var recIndex = (record != undefined) ? record.get('index') : -1, - len = picker.store.length; + len = picker.store.length, + pivotIndex = record.get('pivotIndex'); this.miMoveUp.setDisabled(recIndex<1); this.miMoveDown.setDisabled(recIndex>len-2 || recIndex<0); this.miMoveBegin.setDisabled(recIndex<1); this.miMoveEnd.setDisabled(recIndex>len-2 || recIndex<0); - this.miFieldSettings.setDisabled(record.get('pivotIndex')==-2); + this.miMoveFilter.setDisabled(type == 3 || pivotIndex==-2); // menu for filter + this.miMoveRow.setDisabled(type == 1); // menu for row + this.miMoveColumn.setDisabled(type == 0); // menu for column + this.miMoveValues.setDisabled(type == 2 || pivotIndex==-2); // menu for value + + this.miFieldSettings.setDisabled(pivotIndex==-2); var menu = this.fieldsMenu, showPoint, me = this,