[SSE] Show slicer settings
This commit is contained in:
parent
f19437168f
commit
61b38d6888
|
@ -71,7 +71,8 @@ define([
|
||||||
'spreadsheeteditor/main/app/view/ImageSettingsAdvanced',
|
'spreadsheeteditor/main/app/view/ImageSettingsAdvanced',
|
||||||
'spreadsheeteditor/main/app/view/SetValueDialog',
|
'spreadsheeteditor/main/app/view/SetValueDialog',
|
||||||
'spreadsheeteditor/main/app/view/AutoFilterDialog',
|
'spreadsheeteditor/main/app/view/AutoFilterDialog',
|
||||||
'spreadsheeteditor/main/app/view/SpecialPasteDialog'
|
'spreadsheeteditor/main/app/view/SpecialPasteDialog',
|
||||||
|
'spreadsheeteditor/main/app/view/SlicerSettings'
|
||||||
], function () {
|
], function () {
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
|
@ -224,6 +225,7 @@ define([
|
||||||
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
|
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
|
||||||
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me));
|
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, me));
|
||||||
view.mnuImgAdvanced.on('click', _.bind(me.onImgAdvanced, me));
|
view.mnuImgAdvanced.on('click', _.bind(me.onImgAdvanced, me));
|
||||||
|
view.mnuSlicerAdvanced.on('click', _.bind(me.onSlicerAdvanced, me));
|
||||||
view.textInShapeMenu.on('render:after', _.bind(me.onTextInShapeAfterRender, me));
|
view.textInShapeMenu.on('render:after', _.bind(me.onTextInShapeAfterRender, me));
|
||||||
view.menuSignatureEditSign.on('click', _.bind(me.onSignatureClick, me));
|
view.menuSignatureEditSign.on('click', _.bind(me.onSignatureClick, me));
|
||||||
view.menuSignatureEditSetup.on('click', _.bind(me.onSignatureClick, me));
|
view.menuSignatureEditSetup.on('click', _.bind(me.onSignatureClick, me));
|
||||||
|
@ -878,6 +880,25 @@ define([
|
||||||
})).show();
|
})).show();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onSlicerAdvanced: function(item) {
|
||||||
|
var me = this;
|
||||||
|
|
||||||
|
(new SSE.Views.SlicerSettings({
|
||||||
|
props : item.imageInfo,
|
||||||
|
api : me.api,
|
||||||
|
handler : function(result, value) {
|
||||||
|
if (result == 'ok') {
|
||||||
|
if (me.api) {
|
||||||
|
me.api.asc_setGraphicObjectProps(value.imageProps);
|
||||||
|
|
||||||
|
Common.component.Analytics.trackEvent('DocumentHolder', 'Apply slicer settings');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', me);
|
||||||
|
}
|
||||||
|
})).show();
|
||||||
|
},
|
||||||
|
|
||||||
onChartEdit: function(item) {
|
onChartEdit: function(item) {
|
||||||
var me = this;
|
var me = this;
|
||||||
var win, props;
|
var win, props;
|
||||||
|
@ -1619,6 +1640,7 @@ define([
|
||||||
has_chartprops = true;
|
has_chartprops = true;
|
||||||
} else {
|
} else {
|
||||||
documentHolder.mnuImgAdvanced.imageInfo = elValue;
|
documentHolder.mnuImgAdvanced.imageInfo = elValue;
|
||||||
|
documentHolder.mnuSlicerAdvanced.imageInfo = elValue;
|
||||||
isimagemenu = true;
|
isimagemenu = true;
|
||||||
}
|
}
|
||||||
if (this.permissions.isSignatureSupport)
|
if (this.permissions.isSignatureSupport)
|
||||||
|
@ -1647,6 +1669,9 @@ define([
|
||||||
if (documentHolder.mnuImgAdvanced.imageInfo)
|
if (documentHolder.mnuImgAdvanced.imageInfo)
|
||||||
documentHolder.menuImgOriginalSize.setDisabled(isObjLocked || documentHolder.mnuImgAdvanced.imageInfo.get_ImageUrl()===null || documentHolder.mnuImgAdvanced.imageInfo.get_ImageUrl()===undefined);
|
documentHolder.menuImgOriginalSize.setDisabled(isObjLocked || documentHolder.mnuImgAdvanced.imageInfo.get_ImageUrl()===null || documentHolder.mnuImgAdvanced.imageInfo.get_ImageUrl()===undefined);
|
||||||
|
|
||||||
|
documentHolder.mnuSlicerAdvanced.setVisible(documentHolder.mnuImgAdvanced.imageInfo &&documentHolder.mnuImgAdvanced.imageInfo.asc_getSlicerProperties());
|
||||||
|
documentHolder.mnuSlicerAdvanced.setDisabled(isObjLocked);
|
||||||
|
|
||||||
var pluginGuid = (documentHolder.mnuImgAdvanced.imageInfo) ? documentHolder.mnuImgAdvanced.imageInfo.asc_getPluginGuid() : null;
|
var pluginGuid = (documentHolder.mnuImgAdvanced.imageInfo) ? documentHolder.mnuImgAdvanced.imageInfo.asc_getPluginGuid() : null;
|
||||||
documentHolder.menuImgReplace.setVisible(isimageonly && (pluginGuid===null || pluginGuid===undefined));
|
documentHolder.menuImgReplace.setVisible(isimageonly && (pluginGuid===null || pluginGuid===undefined));
|
||||||
documentHolder.menuImgReplace.setDisabled(isObjLocked || pluginGuid===null);
|
documentHolder.menuImgReplace.setDisabled(isObjLocked || pluginGuid===null);
|
||||||
|
@ -1671,6 +1696,7 @@ define([
|
||||||
|
|
||||||
if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event);
|
if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event);
|
||||||
documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible() || documentHolder.mnuImgAdvanced.isVisible());
|
documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible() || documentHolder.mnuImgAdvanced.isVisible());
|
||||||
|
documentHolder.mnuSlicerSeparator.setVisible(documentHolder.mnuSlicerAdvanced.isVisible());
|
||||||
} else if (istextshapemenu || istextchartmenu) {
|
} else if (istextshapemenu || istextchartmenu) {
|
||||||
if (!documentHolder.textInShapeMenu || !showMenu && !documentHolder.textInShapeMenu.isVisible()) return;
|
if (!documentHolder.textInShapeMenu || !showMenu && !documentHolder.textInShapeMenu.isVisible()) return;
|
||||||
|
|
||||||
|
|
|
@ -567,6 +567,14 @@ define([
|
||||||
caption : me.advancedImgText
|
caption : me.advancedImgText
|
||||||
});
|
});
|
||||||
|
|
||||||
|
me.mnuSlicerSeparator = new Common.UI.MenuItem({
|
||||||
|
caption : '--'
|
||||||
|
});
|
||||||
|
|
||||||
|
me.mnuSlicerAdvanced = new Common.UI.MenuItem({
|
||||||
|
caption : me.advancedSlicerText
|
||||||
|
});
|
||||||
|
|
||||||
me.mnuChartEdit = new Common.UI.MenuItem({
|
me.mnuChartEdit = new Common.UI.MenuItem({
|
||||||
caption : me.chartText
|
caption : me.chartText
|
||||||
});
|
});
|
||||||
|
@ -761,7 +769,9 @@ define([
|
||||||
me.mnuShapeAdvanced,
|
me.mnuShapeAdvanced,
|
||||||
me.menuImgOriginalSize,
|
me.menuImgOriginalSize,
|
||||||
me.menuImgReplace,
|
me.menuImgReplace,
|
||||||
me.mnuImgAdvanced
|
me.mnuImgAdvanced,
|
||||||
|
me.mnuSlicerSeparator,
|
||||||
|
me.mnuSlicerAdvanced
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1100,7 +1110,8 @@ define([
|
||||||
textCropFill: 'Fill',
|
textCropFill: 'Fill',
|
||||||
textCropFit: 'Fit',
|
textCropFit: 'Fit',
|
||||||
textListSettings: 'List Settings',
|
textListSettings: 'List Settings',
|
||||||
textFromStorage: 'From Storage'
|
textFromStorage: 'From Storage',
|
||||||
|
advancedSlicerText: 'Slicer Settings'
|
||||||
|
|
||||||
}, SSE.Views.DocumentHolder || {}));
|
}, SSE.Views.DocumentHolder || {}));
|
||||||
});
|
});
|
|
@ -296,19 +296,35 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettings.template',
|
||||||
},
|
},
|
||||||
|
|
||||||
_setDefaults: function(props) {
|
_setDefaults: function(props) {
|
||||||
if (props ){
|
if (props){
|
||||||
this._noApply = true;
|
var value = props.asc_getWidth();
|
||||||
|
this.numWidth.setValue((value!==null) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
|
||||||
|
value = props.asc_getHeight();
|
||||||
|
this.numHeight.setValue((value!==null) ? Common.Utils.Metric.fnRecalcFromMM(value).toFixed(2) : '', true);
|
||||||
|
|
||||||
// depents of data type
|
var slicerprops = props.asc_getSlicerProperties();
|
||||||
this.radioAsc.setCaption(this.textAsc + ' (' + this.textSmallLarge + ')' );
|
if (slicerprops) {
|
||||||
this.radioDesc.setCaption(this.textDesc + ' (' + this.textLargeSmall + ')' );
|
this._noApply = true;
|
||||||
|
|
||||||
this.lblSource.text('Source name');
|
this.numCols.setValue(slicerprops.asc_getColumnCount(), true);
|
||||||
this.lblFormula.text('Name in formulas');
|
// this.numColWidth.setValue(Common.Utils.Metric.fnRecalcFromMM(slicerprops.asc_getColWidth()).toFixed(2), true);
|
||||||
|
this.numColHeight.setValue(Common.Utils.Metric.fnRecalcFromMM(slicerprops.asc_getRowHeight()).toFixed(2), true);
|
||||||
|
|
||||||
this._noApply = false;
|
this.inputHeader.setValue(slicerprops.asc_getCaption());
|
||||||
|
this.chHeader.setValue(!!slicerprops.asc_getShowCaption());
|
||||||
|
|
||||||
this._changedProps = new Asc.asc_CParagraphProperty();
|
// depends of data type
|
||||||
|
this.radioAsc.setCaption(this.textAsc + ' (' + this.textSmallLarge + ')' );
|
||||||
|
this.radioDesc.setCaption(this.textDesc + ' (' + this.textLargeSmall + ')' );
|
||||||
|
|
||||||
|
this.inputName.setValue(slicerprops.asc_getName());
|
||||||
|
this.lblSource.text('Source name');
|
||||||
|
this.lblFormula.text('Name in formulas');
|
||||||
|
|
||||||
|
this._noApply = false;
|
||||||
|
|
||||||
|
this._changedProps = slicerprops;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue