[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/SetValueDialog',
|
||||
'spreadsheeteditor/main/app/view/AutoFilterDialog',
|
||||
'spreadsheeteditor/main/app/view/SpecialPasteDialog'
|
||||
'spreadsheeteditor/main/app/view/SpecialPasteDialog',
|
||||
'spreadsheeteditor/main/app/view/SlicerSettings'
|
||||
], function () {
|
||||
'use strict';
|
||||
|
||||
|
@ -224,6 +225,7 @@ define([
|
|||
view.mnuShapeAdvanced.on('click', _.bind(me.onShapeAdvanced, me));
|
||||
view.mnuChartEdit.on('click', _.bind(me.onChartEdit, 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.menuSignatureEditSign.on('click', _.bind(me.onSignatureClick, me));
|
||||
view.menuSignatureEditSetup.on('click', _.bind(me.onSignatureClick, me));
|
||||
|
@ -878,6 +880,25 @@ define([
|
|||
})).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) {
|
||||
var me = this;
|
||||
var win, props;
|
||||
|
@ -1619,6 +1640,7 @@ define([
|
|||
has_chartprops = true;
|
||||
} else {
|
||||
documentHolder.mnuImgAdvanced.imageInfo = elValue;
|
||||
documentHolder.mnuSlicerAdvanced.imageInfo = elValue;
|
||||
isimagemenu = true;
|
||||
}
|
||||
if (this.permissions.isSignatureSupport)
|
||||
|
@ -1647,6 +1669,9 @@ define([
|
|||
if (documentHolder.mnuImgAdvanced.imageInfo)
|
||||
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;
|
||||
documentHolder.menuImgReplace.setVisible(isimageonly && (pluginGuid===null || pluginGuid===undefined));
|
||||
documentHolder.menuImgReplace.setDisabled(isObjLocked || pluginGuid===null);
|
||||
|
@ -1671,6 +1696,7 @@ define([
|
|||
|
||||
if (showMenu) this.showPopupMenu(documentHolder.imgMenu, {}, event);
|
||||
documentHolder.mnuShapeSeparator.setVisible(documentHolder.mnuShapeAdvanced.isVisible() || documentHolder.mnuChartEdit.isVisible() || documentHolder.mnuImgAdvanced.isVisible());
|
||||
documentHolder.mnuSlicerSeparator.setVisible(documentHolder.mnuSlicerAdvanced.isVisible());
|
||||
} else if (istextshapemenu || istextchartmenu) {
|
||||
if (!documentHolder.textInShapeMenu || !showMenu && !documentHolder.textInShapeMenu.isVisible()) return;
|
||||
|
||||
|
|
|
@ -567,6 +567,14 @@ define([
|
|||
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({
|
||||
caption : me.chartText
|
||||
});
|
||||
|
@ -761,7 +769,9 @@ define([
|
|||
me.mnuShapeAdvanced,
|
||||
me.menuImgOriginalSize,
|
||||
me.menuImgReplace,
|
||||
me.mnuImgAdvanced
|
||||
me.mnuImgAdvanced,
|
||||
me.mnuSlicerSeparator,
|
||||
me.mnuSlicerAdvanced
|
||||
]
|
||||
});
|
||||
|
||||
|
@ -1100,7 +1110,8 @@ define([
|
|||
textCropFill: 'Fill',
|
||||
textCropFit: 'Fit',
|
||||
textListSettings: 'List Settings',
|
||||
textFromStorage: 'From Storage'
|
||||
textFromStorage: 'From Storage',
|
||||
advancedSlicerText: 'Slicer Settings'
|
||||
|
||||
}, SSE.Views.DocumentHolder || {}));
|
||||
});
|
|
@ -296,19 +296,35 @@ define([ 'text!spreadsheeteditor/main/app/template/SlicerSettings.template',
|
|||
},
|
||||
|
||||
_setDefaults: function(props) {
|
||||
if (props ){
|
||||
this._noApply = true;
|
||||
if (props){
|
||||
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
|
||||
this.radioAsc.setCaption(this.textAsc + ' (' + this.textSmallLarge + ')' );
|
||||
this.radioDesc.setCaption(this.textDesc + ' (' + this.textLargeSmall + ')' );
|
||||
var slicerprops = props.asc_getSlicerProperties();
|
||||
if (slicerprops) {
|
||||
this._noApply = true;
|
||||
|
||||
this.lblSource.text('Source name');
|
||||
this.lblFormula.text('Name in formulas');
|
||||
this.numCols.setValue(slicerprops.asc_getColumnCount(), true);
|
||||
// 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