[SSE] Update layout properties and lock/unlock layout buttons
This commit is contained in:
parent
3658506052
commit
e0690974f0
|
@ -162,7 +162,8 @@ define([
|
||||||
langId: undefined,
|
langId: undefined,
|
||||||
pgsize: [0, 0],
|
pgsize: [0, 0],
|
||||||
pgmargins: undefined,
|
pgmargins: undefined,
|
||||||
pgorient: undefined
|
pgorient: undefined,
|
||||||
|
lock_doc: undefined
|
||||||
};
|
};
|
||||||
|
|
||||||
var checkInsertAutoshape = function(e, action) {
|
var checkInsertAutoshape = function(e, action) {
|
||||||
|
@ -1402,6 +1403,9 @@ define([
|
||||||
this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', _.bind(this.onApiSheetChanged, this));
|
this.api.asc_registerCallback('asc_onUpdateSheetViewSettings', _.bind(this.onApiSheetChanged, this));
|
||||||
this.api.asc_registerCallback('asc_onEndAddShape', _.bind(this.onApiEndAddShape, this));
|
this.api.asc_registerCallback('asc_onEndAddShape', _.bind(this.onApiEndAddShape, this));
|
||||||
this.api.asc_registerCallback('asc_onEditorSelectionChanged', _.bind(this.onApiEditorSelectionChanged, this));
|
this.api.asc_registerCallback('asc_onEditorSelectionChanged', _.bind(this.onApiEditorSelectionChanged, this));
|
||||||
|
this.api.asc_registerCallback('asc_onUpdateDocumentProps', _.bind(this.onUpdateDocumentProps, this));
|
||||||
|
this.api.asc_registerCallback('asc_onLockDocumentProps', _.bind(this.onApiLockDocumentProps, this));
|
||||||
|
this.api.asc_registerCallback('asc_onUnLockDocumentProps', _.bind(this.onApiUnLockDocumentProps, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !this.appConfig.isEditMailMerge ) {
|
if ( !this.appConfig.isEditMailMerge ) {
|
||||||
|
@ -1685,15 +1689,24 @@ define([
|
||||||
|
|
||||||
onApiZoomChange: function(zf, type){},
|
onApiZoomChange: function(zf, type){},
|
||||||
|
|
||||||
|
|
||||||
onApiSheetChanged: function() {
|
onApiSheetChanged: function() {
|
||||||
if (!this.toolbar.mode || !this.toolbar.mode.isEdit) return;
|
if (!this.toolbar.mode || !this.toolbar.mode.isEdit) return;
|
||||||
|
|
||||||
var props = this.api.asc_getPageOptions(this.api.asc_getActiveWorksheetIndex()),
|
var currentSheet = this.api.asc_getActiveWorksheetIndex(),
|
||||||
|
props = this.api.asc_getPageOptions(currentSheet),
|
||||||
opt = props.asc_getPageSetup();
|
opt = props.asc_getPageSetup();
|
||||||
|
|
||||||
this.onApiPageOrient(opt.asc_getOrientation());
|
this.onApiPageOrient(opt.asc_getOrientation());
|
||||||
this.onApiPageSize(opt.asc_getWidth(), opt.asc_getHeight());
|
this.onApiPageSize(opt.asc_getWidth(), opt.asc_getHeight());
|
||||||
this.onApiPageMargins(props.asc_getPageMargins());
|
this.onApiPageMargins(props.asc_getPageMargins());
|
||||||
|
|
||||||
|
this.api.asc_isLayoutLocked(currentSheet) ? this.onApiLockDocumentProps(currentSheet) : this.onApiUnLockDocumentProps(currentSheet);
|
||||||
|
},
|
||||||
|
|
||||||
|
onUpdateDocumentProps: function(nIndex) {
|
||||||
|
if (nIndex == this.api.asc_getActiveWorksheetIndex())
|
||||||
|
this.onApiSheetChanged();
|
||||||
},
|
},
|
||||||
|
|
||||||
onApiPageSize: function(w, h) {
|
onApiPageSize: function(w, h) {
|
||||||
|
@ -1748,6 +1761,20 @@ define([
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
onApiLockDocumentProps: function(nIndex) {
|
||||||
|
if (this._state.lock_doc!==true && nIndex == this.api.asc_getActiveWorksheetIndex()) {
|
||||||
|
this.toolbar.lockToolbar(SSE.enumLock.docPropsLock, true, {array: [this.toolbar.btnPageSize, this.toolbar.btnPageMargins, this.toolbar.btnPageOrient]});
|
||||||
|
this._state.lock_doc = true;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
onApiUnLockDocumentProps: function(nIndex) {
|
||||||
|
if (this._state.lock_doc!==false && nIndex == this.api.asc_getActiveWorksheetIndex()) {
|
||||||
|
this.toolbar.lockToolbar(SSE.enumLock.docPropsLock, false, {array: [this.toolbar.btnPageSize, this.toolbar.btnPageMargins, this.toolbar.btnPageOrient]});
|
||||||
|
this._state.lock_doc = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
onApiEditorSelectionChanged: function(fontobj) {
|
onApiEditorSelectionChanged: function(fontobj) {
|
||||||
if (!this.editMode) return;
|
if (!this.editMode) return;
|
||||||
|
|
||||||
|
|
|
@ -84,6 +84,7 @@ define([
|
||||||
cantModifyFilter: 'cant-filter',
|
cantModifyFilter: 'cant-filter',
|
||||||
cantGroup: 'cant-group',
|
cantGroup: 'cant-group',
|
||||||
cantGroupUngroup: 'cant-group-ungroup',
|
cantGroupUngroup: 'cant-group-ungroup',
|
||||||
|
docPropsLock: 'doc-props-lock'
|
||||||
};
|
};
|
||||||
|
|
||||||
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
|
SSE.Views.Toolbar = Common.UI.Mixtbar.extend(_.extend({
|
||||||
|
@ -1212,7 +1213,7 @@ define([
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-pageorient',
|
iconCls: 'btn-pageorient',
|
||||||
caption: me.capBtnPageOrient,
|
caption: me.capBtnPageOrient,
|
||||||
lock : [_set.lostConnect, _set.coAuth],
|
lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth],
|
||||||
menu: new Common.UI.Menu({
|
menu: new Common.UI.Menu({
|
||||||
cls: 'ppm-toolbar',
|
cls: 'ppm-toolbar',
|
||||||
items: [
|
items: [
|
||||||
|
@ -1247,7 +1248,7 @@ define([
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-pagemargins',
|
iconCls: 'btn-pagemargins',
|
||||||
caption: me.capBtnMargins,
|
caption: me.capBtnMargins,
|
||||||
lock : [_set.lostConnect, _set.coAuth],
|
lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth],
|
||||||
menu: new Common.UI.Menu({
|
menu: new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
@ -1292,7 +1293,7 @@ define([
|
||||||
cls: 'btn-toolbar x-huge icon-top',
|
cls: 'btn-toolbar x-huge icon-top',
|
||||||
iconCls: 'btn-pagesize',
|
iconCls: 'btn-pagesize',
|
||||||
caption: me.capBtnPageSize,
|
caption: me.capBtnPageSize,
|
||||||
lock : [_set.lostConnect, _set.coAuth],
|
lock : [_set.docPropsLock, _set.lostConnect, _set.coAuth],
|
||||||
menu: new Common.UI.Menu({
|
menu: new Common.UI.Menu({
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue