[DE][PE][SSE] synchronize extra buttons state through events
This commit is contained in:
parent
cb82ea8230
commit
5f1b291886
|
@ -595,6 +595,13 @@ define([
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( !!me.options.signals ) {
|
||||
var opts = me.options.signals;
|
||||
if ( !(opts.indexOf('disabled') < 0) ) {
|
||||
me.trigger('disabled', me, disabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.disabled = disabled;
|
||||
|
|
|
@ -91,7 +91,8 @@ define([
|
|||
'Toolbar': {
|
||||
'file:settings': _.bind(this.clickToolbarSettings,this),
|
||||
'file:open': this.clickToolbarTab.bind(this, 'file'),
|
||||
'file:close': this.clickToolbarTab.bind(this, 'other')
|
||||
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
||||
'save:disabled': this.changeToolbarSaveState.bind(this)
|
||||
},
|
||||
'SearchDialog': {
|
||||
'hide': _.bind(this.onSearchDlgHide, this),
|
||||
|
@ -398,6 +399,10 @@ define([
|
|||
this.leftMenu.menuFile.hide();
|
||||
},
|
||||
|
||||
changeToolbarSaveState: function (state) {
|
||||
this.leftMenu.menuFile.getButton('save').setDisabled(state);
|
||||
},
|
||||
|
||||
/** coauthoring begin **/
|
||||
clickStatusbarUsers: function() {
|
||||
this.leftMenu.menuFile.panels['rights'].changeAccessRights();
|
||||
|
|
|
@ -622,12 +622,7 @@ define([
|
|||
forcesave = this.appOptions.forcesave,
|
||||
isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||
isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1528,12 +1523,7 @@ define([
|
|||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||
forcesave = this.appOptions.forcesave,
|
||||
isDisabled = !isModified && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
|
||||
/** coauthoring begin **/
|
||||
|
@ -1549,12 +1539,7 @@ define([
|
|||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||
forcesave = this.appOptions.forcesave,
|
||||
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -231,8 +231,11 @@ define([
|
|||
|
||||
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
|
||||
toolbar.btnSave.on('click', _.bind(this.onSave, this));
|
||||
toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
||||
toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled'));
|
||||
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
|
||||
toolbar.btnRedo.on('disabled', _.bind(this.onBtnChangeState, this, 'redo:disabled'));
|
||||
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
|
||||
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
|
||||
toolbar.btnIncFontSize.on('click', _.bind(this.onIncrease, this));
|
||||
|
@ -920,7 +923,7 @@ define([
|
|||
this.api.asc_Save();
|
||||
}
|
||||
|
||||
toolbar.btnsSave.setDisabled(!toolbar.mode.forcesave);
|
||||
toolbar.btnSave.setDisabled(!toolbar.mode.forcesave);
|
||||
|
||||
Common.NotificationCenter.trigger('edit:complete', toolbar);
|
||||
|
||||
|
@ -928,6 +931,13 @@ define([
|
|||
Common.component.Analytics.trackEvent('ToolBar', 'Save');
|
||||
},
|
||||
|
||||
onBtnChangeState: function(prop) {
|
||||
if ( /\:disabled$/.test(prop) ) {
|
||||
var _is_disabled = arguments[2];
|
||||
this.toolbar.fireEvent(prop, [_is_disabled]);
|
||||
}
|
||||
},
|
||||
|
||||
onUndo: function(btn, e) {
|
||||
if (this.api)
|
||||
this.api.Undo();
|
||||
|
@ -2701,7 +2711,7 @@ define([
|
|||
|
||||
toolbar._state.previewmode = reviewmode && disable;
|
||||
if (reviewmode) {
|
||||
toolbar._state.previewmode && toolbar.btnsSave.setDisabled(true);
|
||||
toolbar._state.previewmode && toolbar.btnSave.setDisabled(true);
|
||||
|
||||
if (toolbar.needShowSynchTip) {
|
||||
toolbar.needShowSynchTip = false;
|
||||
|
|
|
@ -77,6 +77,18 @@ define([
|
|||
'view:compact' : function (toolbar, state) {
|
||||
me.viewport.vlayout.getItem('toolbar').height = state ?
|
||||
Common.Utils.InternalSettings.get('toolbar-height-compact') : Common.Utils.InternalSettings.get('toolbar-height-normal');
|
||||
},
|
||||
'undo:disabled' : function (state) {
|
||||
if ( me.header.btnUndo )
|
||||
me.header.btnUndo.setDisabled(state);
|
||||
},
|
||||
'redo:disabled' : function (state) {
|
||||
if ( me.header.btnRedo )
|
||||
me.header.btnRedo.setDisabled(state);
|
||||
},
|
||||
'save:disabled' : function (state) {
|
||||
if ( me.header.btnSave )
|
||||
me.header.btnSave.setDisabled(state);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -120,22 +120,24 @@ define([
|
|||
this.btnSave = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-save',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'no-mask ' + this.btnSaveCls
|
||||
iconCls: 'no-mask ' + this.btnSaveCls,
|
||||
signals: ['disabled']
|
||||
});
|
||||
this.toolbarControls.push(this.btnSave);
|
||||
me.btnsSave = createButtonSet( me.btnSave );
|
||||
|
||||
this.btnUndo = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-undo',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'btn-undo'
|
||||
iconCls: 'btn-undo',
|
||||
signals: ['disabled']
|
||||
});
|
||||
this.toolbarControls.push(this.btnUndo);
|
||||
|
||||
this.btnRedo = new Common.UI.Button({
|
||||
id: 'id-toolbar-btn-redo',
|
||||
cls: 'btn-toolbar',
|
||||
iconCls: 'btn-redo'
|
||||
iconCls: 'btn-redo',
|
||||
signals: ['disabled']
|
||||
});
|
||||
this.toolbarControls.push(this.btnRedo);
|
||||
|
||||
|
@ -1957,18 +1959,6 @@ define([
|
|||
maxRows: 8,
|
||||
maxColumns: 10
|
||||
});
|
||||
|
||||
var btnsave = DE.getController('LeftMenu').getView('LeftMenu').getMenu('file').getButton('save');
|
||||
if (btnsave && this.btnsSave) {
|
||||
this.btnsSave.add(btnsave);
|
||||
this.toolbarControls.push(btnsave);
|
||||
}
|
||||
|
||||
btnsave = DE.getController('Viewport').getView('Common.Views.Header').getButton('save');
|
||||
if (btnsave && this.btnsSave) {
|
||||
this.btnsSave.add(btnsave);
|
||||
this.toolbarControls.push(btnsave);
|
||||
}
|
||||
},
|
||||
|
||||
onToolbarAfterRender: function(toolbar) {
|
||||
|
@ -2052,7 +2042,7 @@ define([
|
|||
|
||||
setMode: function (mode) {
|
||||
if (mode.isDisconnected) {
|
||||
this.btnsSave.setDisabled(true);
|
||||
this.btnSave.setDisabled(true);
|
||||
if (mode.disableDownload)
|
||||
this.btnPrint.setDisabled(true);
|
||||
}
|
||||
|
@ -2143,7 +2133,7 @@ define([
|
|||
this.btnSave.updateHint(this.tipSynchronize + Common.Utils.String.platformKey('Ctrl+S'));
|
||||
}
|
||||
|
||||
this.btnsSave.setDisabled(false);
|
||||
this.btnSave.setDisabled(false);
|
||||
Common.Gateway.collaborativeChanges();
|
||||
},
|
||||
|
||||
|
@ -2174,7 +2164,7 @@ define([
|
|||
if (this.synchTooltip)
|
||||
this.synchTooltip.hide();
|
||||
this.btnSave.updateHint(this.btnSaveTip);
|
||||
this.btnsSave.setDisabled(!me.mode.forcesave);
|
||||
this.btnSave.setDisabled(!me.mode.forcesave);
|
||||
this._state.hasCollaborativeChanges = false;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,8 @@ define([
|
|||
'Toolbar': {
|
||||
'file:settings': _.bind(this.clickToolbarSettings,this),
|
||||
'file:open': this.clickToolbarTab.bind(this, 'file'),
|
||||
'file:close': this.clickToolbarTab.bind(this, 'other')
|
||||
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
||||
'save:disabled' : this.changeToolbarSaveState.bind(this)
|
||||
},
|
||||
'SearchDialog': {
|
||||
'hide': _.bind(this.onSearchDlgHide, this),
|
||||
|
@ -311,6 +312,11 @@ define([
|
|||
this.leftMenu.menuFile.hide();
|
||||
},
|
||||
|
||||
changeToolbarSaveState: function (state) {
|
||||
this.leftMenu.menuFile.getButton('save').setDisabled(state);
|
||||
console.log('save: ' + state);
|
||||
},
|
||||
|
||||
/** coauthoring begin **/
|
||||
clickStatusbarUsers: function() {
|
||||
this.leftMenu.menuFile.panels['rights'].changeAccessRights();
|
||||
|
|
|
@ -417,12 +417,7 @@ define([
|
|||
forcesave = this.appOptions.forcesave,
|
||||
isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||
isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1271,12 +1266,7 @@ define([
|
|||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||
forcesave = this.appOptions.forcesave,
|
||||
isDisabled = !isModified && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
},
|
||||
onDocumentCanSaveChanged: function (isCanSave) {
|
||||
|
@ -1285,12 +1275,7 @@ define([
|
|||
var isSyncButton = $('.icon', toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||
forcesave = this.appOptions.forcesave,
|
||||
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -217,10 +217,14 @@ define([
|
|||
},
|
||||
|
||||
onLaunch: function() {
|
||||
// Create toolbar view
|
||||
this.toolbar = this.createView('Toolbar');
|
||||
|
||||
var me = this;
|
||||
|
||||
// Create toolbar view
|
||||
me.toolbar = me.createView('Toolbar');
|
||||
me.toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
||||
me.toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled'));
|
||||
me.toolbar.btnRedo.on('disabled', _.bind(this.onBtnChangeState, this, 'redo:disabled'));
|
||||
|
||||
Common.NotificationCenter.on('app:ready', me.onAppReady.bind(me));
|
||||
Common.NotificationCenter.on('app:face', me.onAppShowed.bind(me));
|
||||
|
||||
|
@ -922,6 +926,13 @@ define([
|
|||
Common.component.Analytics.trackEvent('ToolBar', 'Save');
|
||||
},
|
||||
|
||||
onBtnChangeState: function(prop) {
|
||||
if ( /\:disabled$/.test(prop) ) {
|
||||
var _is_disabled = arguments[2];
|
||||
this.toolbar.fireEvent(prop, [_is_disabled]);
|
||||
}
|
||||
},
|
||||
|
||||
onUndo: function(btn, e) {
|
||||
if (this.api) {
|
||||
this.api.Undo();
|
||||
|
|
|
@ -78,6 +78,19 @@ define([
|
|||
'view:compact' : function (toolbar, state) {
|
||||
me.viewport.vlayout.getItem('toolbar').height = state ?
|
||||
Common.Utils.InternalSettings.get('toolbar-height-compact') : Common.Utils.InternalSettings.get('toolbar-height-normal');
|
||||
},
|
||||
'undo:disabled' : function (state) {
|
||||
if ( me.header.btnUndo )
|
||||
me.header.btnUndo.setDisabled(state);
|
||||
},
|
||||
'redo:disabled' : function (state) {
|
||||
if ( me.header.btnRedo )
|
||||
me.header.btnRedo.setDisabled(state);
|
||||
},
|
||||
'save:disabled' : function (state) {
|
||||
if ( me.header.btnSave )
|
||||
me.header.btnSave.setDisabled(state);
|
||||
console.log('header save: ' + state);
|
||||
}
|
||||
},
|
||||
// Events generated by main view
|
||||
|
|
|
@ -170,15 +170,16 @@ define([
|
|||
id : 'id-toolbar-btn-save',
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'no-mask ' + me.btnSaveCls,
|
||||
lock : [_set.lostConnect]
|
||||
lock : [_set.lostConnect],
|
||||
signals : ['disabled']
|
||||
});
|
||||
me.btnsSave = createButtonSet(me.btnSave);
|
||||
|
||||
me.btnUndo = new Common.UI.Button({
|
||||
id : 'id-toolbar-btn-undo',
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'btn-undo',
|
||||
lock : [_set.undoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart]
|
||||
lock : [_set.undoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart],
|
||||
signals : ['disabled']
|
||||
});
|
||||
me.slideOnlyControls.push(me.btnUndo);
|
||||
|
||||
|
@ -186,7 +187,8 @@ define([
|
|||
id : 'id-toolbar-btn-redo',
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'btn-redo',
|
||||
lock : [_set.redoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart]
|
||||
lock : [_set.redoLock, _set.slideDeleted, _set.lostConnect, _set.disableOnStart],
|
||||
signals : ['disabled']
|
||||
});
|
||||
me.slideOnlyControls.push(me.btnRedo);
|
||||
|
||||
|
@ -1340,17 +1342,6 @@ define([
|
|||
// // Enable none paragraph components
|
||||
this.lockToolbar(PE.enumLock.disableOnStart, false, {array: this.slideOnlyControls.concat(this.shapeControls)});
|
||||
|
||||
var btnsave = PE.getController('LeftMenu').getView('LeftMenu').getMenu('file').getButton('save');
|
||||
if (btnsave && this.btnsSave) {
|
||||
this.btnsSave.add(btnsave);
|
||||
this.lockControls.push(btnsave);
|
||||
}
|
||||
btnsave = PE.getController('Viewport').getView('Common.Views.Header').getButton('save');
|
||||
if (btnsave && this.btnsSave) {
|
||||
this.btnsSave.add(btnsave);
|
||||
this.lockControls.push(btnsave);
|
||||
}
|
||||
|
||||
/** coauthoring begin **/
|
||||
this.showSynchTip = !Common.localStorage.getBool('pe-hide-synch');
|
||||
this.needShowSynchTip = false;
|
||||
|
@ -1499,7 +1490,7 @@ define([
|
|||
this.btnSave.updateHint(this.tipSynchronize + Common.Utils.String.platformKey('Ctrl+S'));
|
||||
}
|
||||
|
||||
this.btnsSave.setDisabled(false);
|
||||
this.btnSave.setDisabled(false);
|
||||
Common.Gateway.collaborativeChanges();
|
||||
},
|
||||
|
||||
|
@ -1530,7 +1521,7 @@ define([
|
|||
if (this.synchTooltip)
|
||||
this.synchTooltip.hide();
|
||||
this.btnSave.updateHint(this.btnSaveTip);
|
||||
this.btnsSave.setDisabled(!me.mode.forcesave);
|
||||
this.btnSave.setDisabled(!me.mode.forcesave);
|
||||
|
||||
this._state.hasCollaborativeChanges = false;
|
||||
}
|
||||
|
|
|
@ -79,7 +79,8 @@ define([
|
|||
'Toolbar': {
|
||||
'file:settings': _.bind(this.clickToolbarSettings,this),
|
||||
'file:open': this.clickToolbarTab.bind(this, 'file'),
|
||||
'file:close': this.clickToolbarTab.bind(this, 'other')
|
||||
'file:close': this.clickToolbarTab.bind(this, 'other'),
|
||||
'save:disabled' : this.changeToolbarSaveState.bind(this)
|
||||
},
|
||||
'SearchDialog': {
|
||||
'hide': _.bind(this.onSearchDlgHide, this),
|
||||
|
@ -348,6 +349,10 @@ define([
|
|||
this.leftMenu.menuFile.hide();
|
||||
},
|
||||
|
||||
changeToolbarSaveState: function (state) {
|
||||
this.leftMenu.menuFile.getButton('save').setDisabled(state);
|
||||
},
|
||||
|
||||
/** coauthoring begin **/
|
||||
clickStatusbarUsers: function() {
|
||||
this.leftMenu.menuFile.panels['rights'].changeAccessRights();
|
||||
|
|
|
@ -1417,12 +1417,7 @@ define([
|
|||
forcesave = this.appOptions.forcesave,
|
||||
cansave = this.api.asc_isDocumentCanSave(),
|
||||
isDisabled = !cansave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (this.toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
this.toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
this.toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1431,12 +1426,7 @@ define([
|
|||
var isSyncButton = $('.icon', this.toolbarView.btnSave.cmpEl).hasClass('btn-synch'),
|
||||
forcesave = this.appOptions.forcesave,
|
||||
isDisabled = !isCanSave && !isSyncButton && !forcesave || this._state.isDisconnected || this._state.fastCoauth && this._state.usersCount>1 && !forcesave;
|
||||
if (this.toolbarView.btnSave.isDisabled() !== isDisabled)
|
||||
this.toolbarView.btnsSave.forEach(function(button) {
|
||||
if ( button ) {
|
||||
button.setDisabled(isDisabled);
|
||||
}
|
||||
});
|
||||
this.toolbarView.btnSave.setDisabled(isDisabled);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -247,8 +247,11 @@ define([
|
|||
} else {
|
||||
toolbar.btnPrint.on('click', _.bind(this.onPrint, this));
|
||||
toolbar.btnSave.on('click', _.bind(this.onSave, this));
|
||||
toolbar.btnSave.on('disabled', _.bind(this.onBtnChangeState, this, 'save:disabled'));
|
||||
toolbar.btnUndo.on('click', _.bind(this.onUndo, this));
|
||||
toolbar.btnUndo.on('disabled', _.bind(this.onBtnChangeState, this, 'undo:disabled'));
|
||||
toolbar.btnRedo.on('click', _.bind(this.onRedo, this));
|
||||
toolbar.btnRedo.on('disabled', _.bind(this.onBtnChangeState, this, 'redo:disabled'));
|
||||
toolbar.btnCopy.on('click', _.bind(this.onCopyPaste, this, true));
|
||||
toolbar.btnPaste.on('click', _.bind(this.onCopyPaste, this, false));
|
||||
toolbar.btnIncFontSize.on('click', _.bind(this.onIncreaseFontSize, this));
|
||||
|
@ -396,6 +399,13 @@ define([
|
|||
Common.component.Analytics.trackEvent('ToolBar', 'Save');
|
||||
},
|
||||
|
||||
onBtnChangeState: function(prop) {
|
||||
if ( /\:disabled$/.test(prop) ) {
|
||||
var _is_disabled = arguments[2];
|
||||
this.toolbar.fireEvent(prop, [_is_disabled]);
|
||||
}
|
||||
},
|
||||
|
||||
onUndo: function(btn, e) {
|
||||
if (this.api)
|
||||
this.api.asc_Undo();
|
||||
|
@ -3039,6 +3049,9 @@ define([
|
|||
me.toolbar.setMode(config);
|
||||
|
||||
if ( config.isEdit ) {
|
||||
me.toolbar.btnSave && me.toolbar.btnSave.on('disabled', _.bind(me.onBtnChangeState, me, 'save:disabled'));
|
||||
me.toolbar.btnUndo && me.toolbar.btnUndo.on('disabled', _.bind(me.onBtnChangeState, me, 'undo:disabled'));
|
||||
me.toolbar.btnRedo && me.toolbar.btnRedo.on('disabled', _.bind(me.onBtnChangeState, me, 'redo:disabled'));
|
||||
me.toolbar.setApi(me.api);
|
||||
|
||||
if ( !config.isEditDiagram && !config.isEditMailMerge ) {
|
||||
|
|
|
@ -76,6 +76,18 @@ define([
|
|||
'view:compact' : function (toolbar, state) {
|
||||
me.viewport.vlayout.getItem('toolbar').height = state ?
|
||||
Common.Utils.InternalSettings.get('toolbar-height-compact') : Common.Utils.InternalSettings.get('toolbar-height-normal');
|
||||
},
|
||||
'undo:disabled' : function (state) {
|
||||
if ( me.header.btnUndo )
|
||||
me.header.btnUndo.setDisabled(state);
|
||||
},
|
||||
'redo:disabled' : function (state) {
|
||||
if ( me.header.btnRedo )
|
||||
me.header.btnRedo.setDisabled(state);
|
||||
},
|
||||
'save:disabled' : function (state) {
|
||||
if ( me.header.btnSave )
|
||||
me.header.btnSave.setDisabled(state);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
|
@ -157,7 +157,8 @@ define([
|
|||
cls : 'btn-toolbar',
|
||||
iconCls : 'btn-undo',
|
||||
disabled : true,
|
||||
lock : [_set.lostConnect]
|
||||
lock : [_set.lostConnect],
|
||||
signals : ['disabled']
|
||||
});
|
||||
|
||||
me.btnRedo = new Common.UI.Button({
|
||||
|
@ -165,7 +166,8 @@ define([
|
|||
cls : 'btn-toolbar',
|
||||
iconCls : 'btn-redo',
|
||||
disabled : true,
|
||||
lock : [_set.lostConnect]
|
||||
lock : [_set.lostConnect],
|
||||
signals : ['disabled']
|
||||
});
|
||||
|
||||
return this;
|
||||
|
@ -370,9 +372,9 @@ define([
|
|||
me.btnSave = new Common.UI.Button({
|
||||
id : 'id-toolbar-btn-save',
|
||||
cls : 'btn-toolbar',
|
||||
iconCls : 'no-mask ' + me.btnSaveCls
|
||||
iconCls : 'no-mask ' + me.btnSaveCls,
|
||||
signals : ['disabled']
|
||||
});
|
||||
me.btnsSave = createButtonSet(me.btnSave);
|
||||
|
||||
me.btnIncFontSize = new Common.UI.Button({
|
||||
id : 'id-toolbar-btn-incfont',
|
||||
|
@ -1233,7 +1235,7 @@ define([
|
|||
me.cmbNumberFormat, me.btnBorders, me.btnInsertImage, me.btnInsertHyperlink,
|
||||
me.btnInsertChart, me.btnColorSchemas,
|
||||
me.btnAutofilter, me.btnCopy, me.btnPaste, me.btnSettings, me.listStyles, me.btnPrint, me.btnShowMode,
|
||||
/*me.btnSave, */me.btnClearStyle, me.btnCopyStyle
|
||||
me.btnSave, me.btnClearStyle, me.btnCopyStyle
|
||||
];
|
||||
|
||||
var _temp_array = [me.cmbFontName, me.cmbFontSize, me.btnAlignLeft,me.btnAlignCenter,me.btnAlignRight,me.btnAlignJust,me.btnAlignTop,
|
||||
|
@ -1706,15 +1708,6 @@ define([
|
|||
itemTemplate: _.template('<div id="<%= id %>" class="item-chartlist <%= iconCls %>"></div>')
|
||||
});
|
||||
}
|
||||
|
||||
var btnsave = SSE.getController('LeftMenu').getView('LeftMenu').getMenu('file').getButton('save');
|
||||
if (btnsave && this.btnsSave) {
|
||||
this.btnsSave.add(btnsave);
|
||||
}
|
||||
btnsave = SSE.getController('Viewport').getView('Common.Views.Header').getButton('save');
|
||||
if (btnsave && this.btnsSave) {
|
||||
this.btnsSave.add(btnsave);
|
||||
}
|
||||
},
|
||||
|
||||
onToolbarAfterRender: function(toolbar) {
|
||||
|
@ -1758,8 +1751,6 @@ define([
|
|||
this.lockToolbar( SSE.enumLock.lostConnect, true );
|
||||
this.lockToolbar( SSE.enumLock.lostConnect, true,
|
||||
{array:[this.btnEditChart,this.btnUndo,this.btnRedo]} );
|
||||
this.lockToolbar( SSE.enumLock.lostConnect, true,
|
||||
{array:this.btnsSave} );
|
||||
this.lockToolbar(SSE.enumLock.cantPrint, !mode.canPrint || mode.disableDownload, {array: [this.btnPrint]});
|
||||
} else {
|
||||
this.mode = mode;
|
||||
|
@ -1851,7 +1842,7 @@ define([
|
|||
this.btnSave.updateHint(this.tipSynchronize + Common.Utils.String.platformKey('Ctrl+S'));
|
||||
}
|
||||
|
||||
this.btnsSave.setDisabled(false);
|
||||
this.btnSave.setDisabled(false);
|
||||
Common.Gateway.collaborativeChanges();
|
||||
},
|
||||
|
||||
|
@ -1882,7 +1873,7 @@ define([
|
|||
if (this.synchTooltip)
|
||||
this.synchTooltip.hide();
|
||||
this.btnSave.updateHint(this.btnSaveTip);
|
||||
this.btnsSave.setDisabled(!me.mode.forcesave);
|
||||
this.btnSave.setDisabled(!me.mode.forcesave);
|
||||
|
||||
this._state.hasCollaborativeChanges = false;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue