[SSE] Ole editor: edit visible area
This commit is contained in:
parent
c946104829
commit
63c83192b6
|
@ -922,7 +922,7 @@
|
||||||
background-repeat: no-repeat;
|
background-repeat: no-repeat;
|
||||||
}
|
}
|
||||||
|
|
||||||
&.dropdown-toggle:first-child .inner-box-caret {
|
&:not(.btn-toolbar).dropdown-toggle:first-child .inner-box-caret {
|
||||||
padding: 0 1px 0 2px;
|
padding: 0 1px 0 2px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -320,6 +320,8 @@ define([
|
||||||
toolbar.cmbNumberFormat.on('show:before', _.bind(this.onNumberFormatOpenBefore, this, true));
|
toolbar.cmbNumberFormat.on('show:before', _.bind(this.onNumberFormatOpenBefore, this, true));
|
||||||
if (toolbar.cmbNumberFormat.cmpEl)
|
if (toolbar.cmbNumberFormat.cmpEl)
|
||||||
toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this));
|
toolbar.cmbNumberFormat.cmpEl.on('click', '#id-toolbar-mnu-item-more-formats a', _.bind(this.onNumberFormatSelect, this));
|
||||||
|
toolbar.btnVisibleArea.menu.on('item:click', _.bind(this.onVisibleAreaMenu, this));
|
||||||
|
toolbar.btnVisibleAreaClose.on('click', _.bind(this.onVisibleAreaClose, this));
|
||||||
} else {
|
} else {
|
||||||
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
|
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
|
||||||
toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled'));
|
toolbar.btnPrint.on('disabled', _.bind(this.onBtnChangeState, this, 'print:disabled'));
|
||||||
|
@ -4220,6 +4222,31 @@ define([
|
||||||
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onVisibleAreaClose: function(btn) {
|
||||||
|
if (this.api)
|
||||||
|
this.api.asc_toggleVisibleAreaOleEditor(false);
|
||||||
|
this.toolbar.lockToolbar(Common.enumLock.editVisibleArea, false);
|
||||||
|
this.toolbar.btnVisibleArea.setVisible(true);
|
||||||
|
this.toolbar.btnVisibleAreaClose.setVisible(false);
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
|
},
|
||||||
|
|
||||||
|
onVisibleAreaMenu: function(menu, item, e) {
|
||||||
|
if (this.api) {
|
||||||
|
if (item.value === 'edit') {
|
||||||
|
this.api.asc_toggleVisibleAreaOleEditor(true);
|
||||||
|
this.toolbar.btnVisibleArea.setVisible(false);
|
||||||
|
this.toolbar.btnVisibleAreaClose.setVisible(true);
|
||||||
|
this.toolbar.lockToolbar(Common.enumLock.editVisibleArea, true);
|
||||||
|
} else { // show or hide
|
||||||
|
// this.api.asc_showVisibleArea(item.value === 'show');
|
||||||
|
this.toolbar.btnVisibleArea.menu.items[0].setVisible(item.value !== 'show');
|
||||||
|
this.toolbar.btnVisibleArea.menu.items[1].setVisible(item.value === 'show');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Common.NotificationCenter.trigger('edit:complete', this.toolbar);
|
||||||
|
},
|
||||||
|
|
||||||
textEmptyImgUrl : 'You need to specify image URL.',
|
textEmptyImgUrl : 'You need to specify image URL.',
|
||||||
warnMergeLostData : 'Operation can destroy data in the selected cells.<br>Continue?',
|
warnMergeLostData : 'Operation can destroy data in the selected cells.<br>Continue?',
|
||||||
textWarning : 'Warning',
|
textWarning : 'Warning',
|
||||||
|
|
|
@ -119,6 +119,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="group" style="width: 100%;"></div>
|
<div class="group" style="width: 100%;"></div>
|
||||||
|
<div class="group small" style="padding-right: 5px;">
|
||||||
|
<div class="elset">
|
||||||
|
<span class="btn-slot" id="slot-btn-visible-area"></span>
|
||||||
|
<span class="btn-slot" id="slot-btn-visible-area-close"></span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<% } %>
|
<% } %>
|
||||||
</div>
|
</div>
|
|
@ -109,7 +109,8 @@ define([
|
||||||
wsLockShape: 'worksheet-lock-shape',
|
wsLockShape: 'worksheet-lock-shape',
|
||||||
wsLockFormat: 'worksheet-lock-format',
|
wsLockFormat: 'worksheet-lock-format',
|
||||||
inSmartartInternal: 'in-smartart-internal',
|
inSmartartInternal: 'in-smartart-internal',
|
||||||
wsLockFormatFill: 'worksheet-lock-format-fill'
|
wsLockFormatFill: 'worksheet-lock-format-fill',
|
||||||
|
editVisibleArea: 'is-visible-area'
|
||||||
};
|
};
|
||||||
for (var key in enumLock) {
|
for (var key in enumLock) {
|
||||||
if (enumLock.hasOwnProperty(key)) {
|
if (enumLock.hasOwnProperty(key)) {
|
||||||
|
@ -243,7 +244,7 @@ define([
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-formula',
|
iconCls : 'toolbar__icon btn-formula',
|
||||||
split : true,
|
split : true,
|
||||||
lock : [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth],
|
lock : [_set.editText, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
|
||||||
menu : new Common.UI.Menu({
|
menu : new Common.UI.Menu({
|
||||||
style : 'min-width: 110px',
|
style : 'min-width: 110px',
|
||||||
items : [
|
items : [
|
||||||
|
@ -269,7 +270,7 @@ define([
|
||||||
id : 'id-toolbar-btn-decdecimal',
|
id : 'id-toolbar-btn-decdecimal',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-decdecimal',
|
iconCls : 'toolbar__icon btn-decdecimal',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'bottom'
|
dataHintDirection: 'bottom'
|
||||||
});
|
});
|
||||||
|
@ -278,7 +279,7 @@ define([
|
||||||
id : 'id-toolbar-btn-incdecimal',
|
id : 'id-toolbar-btn-incdecimal',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-incdecimal',
|
iconCls : 'toolbar__icon btn-incdecimal',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'bottom'
|
dataHintDirection: 'bottom'
|
||||||
});
|
});
|
||||||
|
@ -299,7 +300,7 @@ define([
|
||||||
cls : 'input-group-nr',
|
cls : 'input-group-nr',
|
||||||
menuStyle : 'min-width: 180px;',
|
menuStyle : 'min-width: 180px;',
|
||||||
hint : me.tipNumFormat,
|
hint : me.tipNumFormat,
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.selRangeEdit, _set.lostConnect, _set.coAuth, _set.editVisibleArea],
|
||||||
itemsTemplate: formatTemplate,
|
itemsTemplate: formatTemplate,
|
||||||
editable : false,
|
editable : false,
|
||||||
data : me.numFormatData,
|
data : me.numFormatData,
|
||||||
|
@ -357,7 +358,7 @@ define([
|
||||||
id : 'id-toolbar-btn-sort-down',
|
id : 'id-toolbar-btn-sort-down',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-sort-down',
|
iconCls : 'toolbar__icon btn-sort-down',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.editVisibleArea],
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'bottom'
|
dataHintDirection: 'bottom'
|
||||||
});
|
});
|
||||||
|
@ -366,7 +367,7 @@ define([
|
||||||
id : 'id-toolbar-btn-sort-up',
|
id : 'id-toolbar-btn-sort-up',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-sort-up',
|
iconCls : 'toolbar__icon btn-sort-up',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.editVisibleArea],
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'bottom'
|
dataHintDirection: 'bottom'
|
||||||
});
|
});
|
||||||
|
@ -375,7 +376,7 @@ define([
|
||||||
id : 'id-toolbar-btn-setautofilter',
|
id : 'id-toolbar-btn-setautofilter',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-autofilter',
|
iconCls : 'toolbar__icon btn-autofilter',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleFilter, _set.editPivot, _set.editVisibleArea],
|
||||||
enableToggle: true,
|
enableToggle: true,
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'bottom'
|
dataHintDirection: 'bottom'
|
||||||
|
@ -385,11 +386,41 @@ define([
|
||||||
id : 'id-toolbar-btn-clearfilter',
|
id : 'id-toolbar-btn-clearfilter',
|
||||||
cls : 'btn-toolbar',
|
cls : 'btn-toolbar',
|
||||||
iconCls : 'toolbar__icon btn-clear-filter',
|
iconCls : 'toolbar__icon btn-clear-filter',
|
||||||
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleDelFilter, _set.editPivot],
|
lock : [_set.editCell, _set.selChart, _set.selChartText, _set.selShape, _set.selShapeText, _set.selImage, _set.lostConnect, _set.coAuth, _set.ruleDelFilter, _set.editPivot, _set.editVisibleArea],
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'bottom'
|
dataHintDirection: 'bottom'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
if ( config.isEditOle ) {
|
||||||
|
me.btnVisibleArea = new Common.UI.Button({
|
||||||
|
id : 'id-toolbar-btn-visible-area',
|
||||||
|
cls : 'btn-toolbar btn-icon-default',
|
||||||
|
iconCls : 'toolbar__icon btn-sheet-view',
|
||||||
|
menu : new Common.UI.Menu({
|
||||||
|
items: [
|
||||||
|
{caption: me.textShowVA, value: 'show'},
|
||||||
|
{caption: me.textHideVA, value: 'hide', visible: false},
|
||||||
|
{caption: me.textEditVA, value: 'edit'}
|
||||||
|
]
|
||||||
|
}),
|
||||||
|
lock : [_set.lostConnect],
|
||||||
|
dataHint : '1',
|
||||||
|
dataHintDirection: 'bottom'
|
||||||
|
});
|
||||||
|
|
||||||
|
me.btnVisibleAreaClose = new Common.UI.Button({
|
||||||
|
id : 'id-toolbar-btn-visible-area-close',
|
||||||
|
cls : 'btn-toolbar btn-text-default auto',
|
||||||
|
caption : me.textDone,
|
||||||
|
lock : [_set.lostConnect],
|
||||||
|
visible : false,
|
||||||
|
// style : 'min-width: 120px;',
|
||||||
|
dataHint : '1',
|
||||||
|
dataHintDirection: 'bottom',
|
||||||
|
dataHintOffset: 'big'
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
} else if ( config.isEdit ) {
|
} else if ( config.isEdit ) {
|
||||||
Common.UI.Mixtbar.prototype.initialize.call(this, {
|
Common.UI.Mixtbar.prototype.initialize.call(this, {
|
||||||
template: _.template(template),
|
template: _.template(template),
|
||||||
|
@ -1701,7 +1732,7 @@ define([
|
||||||
me.btnCopy, me.btnPaste, me.listStyles, me.btnPrint,
|
me.btnCopy, me.btnPaste, me.listStyles, me.btnPrint,
|
||||||
/*me.btnSave,*/ me.btnClearStyle, me.btnCopyStyle,
|
/*me.btnSave,*/ me.btnClearStyle, me.btnCopyStyle,
|
||||||
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnPrintArea, me.btnPrintTitles, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup, me.btnScale,
|
me.btnPageMargins, me.btnPageSize, me.btnPageOrient, me.btnPrintArea, me.btnPrintTitles, me.btnImgAlign, me.btnImgBackward, me.btnImgForward, me.btnImgGroup, me.btnScale,
|
||||||
me.chPrintGridlines, me.chPrintHeadings
|
me.chPrintGridlines, me.chPrintHeadings, me.btnVisibleArea, me.btnVisibleAreaClose
|
||||||
];
|
];
|
||||||
|
|
||||||
_.each(me.lockControls.concat([me.btnSave]), function(cmp) {
|
_.each(me.lockControls.concat([me.btnSave]), function(cmp) {
|
||||||
|
@ -1916,6 +1947,9 @@ define([
|
||||||
_injectComponent('#slot-img-movebkwd', this.btnImgBackward);
|
_injectComponent('#slot-img-movebkwd', this.btnImgBackward);
|
||||||
_injectComponent('#slot-btn-scale', this.btnScale);
|
_injectComponent('#slot-btn-scale', this.btnScale);
|
||||||
_injectComponent('#slot-btn-condformat', this.btnCondFormat);
|
_injectComponent('#slot-btn-condformat', this.btnCondFormat);
|
||||||
|
_injectComponent('#slot-btn-visible-area', this.btnVisibleArea);
|
||||||
|
_injectComponent('#slot-btn-visible-area-close', this.btnVisibleAreaClose);
|
||||||
|
|
||||||
this.btnsEditHeader = Common.Utils.injectButtons($host.find('.slot-editheader'), 'tlbtn-editheader-', 'toolbar__icon btn-editheader', this.capBtnInsHeader,
|
this.btnsEditHeader = Common.Utils.injectButtons($host.find('.slot-editheader'), 'tlbtn-editheader-', 'toolbar__icon btn-editheader', this.capBtnInsHeader,
|
||||||
[Common.enumLock.editCell, Common.enumLock.selRangeEdit, Common.enumLock.headerLock, Common.enumLock.lostConnect, Common.enumLock.coAuth], undefined, undefined, undefined, '1', 'bottom', 'small');
|
[Common.enumLock.editCell, Common.enumLock.selRangeEdit, Common.enumLock.headerLock, Common.enumLock.lostConnect, Common.enumLock.coAuth], undefined, undefined, undefined, '1', 'bottom', 'small');
|
||||||
Array.prototype.push.apply(this.lockControls, this.btnsEditHeader);
|
Array.prototype.push.apply(this.lockControls, this.btnsEditHeader);
|
||||||
|
@ -1992,6 +2026,7 @@ define([
|
||||||
_updateHint(this.btnPrintTitles, this.tipPrintTitles);
|
_updateHint(this.btnPrintTitles, this.tipPrintTitles);
|
||||||
_updateHint(this.btnScale, this.tipScale);
|
_updateHint(this.btnScale, this.tipScale);
|
||||||
_updateHint(this.btnCondFormat, this.tipCondFormat);
|
_updateHint(this.btnCondFormat, this.tipCondFormat);
|
||||||
|
_updateHint(this.btnVisibleArea, this.tipVisibleArea);
|
||||||
this.btnsEditHeader.forEach(function (btn) {
|
this.btnsEditHeader.forEach(function (btn) {
|
||||||
_updateHint(btn, me.tipEditHeader);
|
_updateHint(btn, me.tipEditHeader);
|
||||||
});
|
});
|
||||||
|
@ -2442,7 +2477,7 @@ define([
|
||||||
if (mode.isDisconnected) {
|
if (mode.isDisconnected) {
|
||||||
this.lockToolbar( Common.enumLock.lostConnect, true );
|
this.lockToolbar( Common.enumLock.lostConnect, true );
|
||||||
this.lockToolbar( Common.enumLock.lostConnect, true,
|
this.lockToolbar( Common.enumLock.lostConnect, true,
|
||||||
{array:[this.btnEditChart, this.btnEditChartData, this.btnEditChartType, this.btnUndo,this.btnRedo,this.btnSave]} );
|
{array:[this.btnEditChart, this.btnEditChartData, this.btnEditChartType, this.btnUndo,this.btnRedo,this.btnSave, this.btnVisibleArea, this.btnVisibleAreaClose]} );
|
||||||
if ( this.synchTooltip )
|
if ( this.synchTooltip )
|
||||||
this.synchTooltip.hide();
|
this.synchTooltip.hide();
|
||||||
if (!mode.enableDownload)
|
if (!mode.enableDownload)
|
||||||
|
@ -2928,6 +2963,11 @@ define([
|
||||||
capInsertSpark: 'Sparklines',
|
capInsertSpark: 'Sparklines',
|
||||||
txtScheme22: 'New Office',
|
txtScheme22: 'New Office',
|
||||||
textPrintGridlines: 'Print gridlines',
|
textPrintGridlines: 'Print gridlines',
|
||||||
textPrintHeadings: 'Print headings'
|
textPrintHeadings: 'Print headings',
|
||||||
|
textShowVA: 'Show Visible Area',
|
||||||
|
textHideVA: 'Hide Visible Area',
|
||||||
|
textEditVA: 'Edit Visible Area',
|
||||||
|
tipVisibleArea: 'Visible area',
|
||||||
|
textDone: 'Done'
|
||||||
}, SSE.Views.Toolbar || {}));
|
}, SSE.Views.Toolbar || {}));
|
||||||
});
|
});
|
Loading…
Reference in a new issue