[SSE] Add handlers for show toolbar, combine statusbar buttons in view tab
This commit is contained in:
parent
0e75d15d57
commit
b68e5b68f5
|
@ -175,7 +175,7 @@ define([
|
||||||
this.statusbar.setVisible(!status);
|
this.statusbar.setVisible(!status);
|
||||||
Common.localStorage.setBool('de-hidden-status', status);
|
Common.localStorage.setBool('de-hidden-status', status);
|
||||||
|
|
||||||
if ($(view).parent().prop('id') !== 'slot-btn-options') {
|
if (view.$el.closest('.btn-slot').prop('id') === 'slot-btn-options') {
|
||||||
this.statusbar.fireEvent('view:hide', [this, status]);
|
this.statusbar.fireEvent('view:hide', [this, status]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -227,7 +227,7 @@ define([
|
||||||
this.statusbar.setVisible(!status);
|
this.statusbar.setVisible(!status);
|
||||||
Common.localStorage.setBool('pe-hidden-status', status);
|
Common.localStorage.setBool('pe-hidden-status', status);
|
||||||
|
|
||||||
if ($(view).parent().prop('id') !== 'slot-btn-options') {
|
if (view.$el.closest('.btn-slot').prop('id') === 'slot-btn-options') {
|
||||||
this.statusbar.fireEvent('view:hide', [this, status]);
|
this.statusbar.fireEvent('view:hide', [this, status]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -70,6 +70,9 @@ define([
|
||||||
},
|
},
|
||||||
'Common.Views.Header': {
|
'Common.Views.Header': {
|
||||||
'statusbar:setcompact': _.bind(this.onChangeViewMode, this)
|
'statusbar:setcompact': _.bind(this.onChangeViewMode, this)
|
||||||
|
},
|
||||||
|
'ViewTab': {
|
||||||
|
'statusbar:setcompact': _.bind(this.onChangeViewMode, this)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
|
@ -145,6 +145,9 @@ define([
|
||||||
},
|
},
|
||||||
'CellSettings': {
|
'CellSettings': {
|
||||||
'cf:init': this.onShowBeforeCondFormat
|
'cf:init': this.onShowBeforeCondFormat
|
||||||
|
},
|
||||||
|
'ViewTab': {
|
||||||
|
'viewtab:showtoolbar': this.onChangeViewMode.bind(this)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Common.NotificationCenter.on('page:settings', _.bind(this.onApiSheetChanged, this));
|
Common.NotificationCenter.on('page:settings', _.bind(this.onApiSheetChanged, this));
|
||||||
|
|
|
@ -79,7 +79,8 @@ define([
|
||||||
this.toolbar = config.toolbar;
|
this.toolbar = config.toolbar;
|
||||||
this.view = this.createView('ViewTab', {
|
this.view = this.createView('ViewTab', {
|
||||||
toolbar: this.toolbar.toolbar,
|
toolbar: this.toolbar.toolbar,
|
||||||
mode: config.mode
|
mode: config.mode,
|
||||||
|
compactToolbar: this.toolbar.toolbar.isCompactView
|
||||||
});
|
});
|
||||||
this.addListeners({
|
this.addListeners({
|
||||||
'ViewTab': {
|
'ViewTab': {
|
||||||
|
@ -95,7 +96,15 @@ define([
|
||||||
'viewtab:manager': this.onOpenManager
|
'viewtab:manager': this.onOpenManager
|
||||||
},
|
},
|
||||||
'Statusbar': {
|
'Statusbar': {
|
||||||
'sheet:changed': this.onApiSheetChanged.bind(this)
|
'sheet:changed': this.onApiSheetChanged.bind(this),
|
||||||
|
'view:compact': _.bind(function (statusbar, state) {
|
||||||
|
this.view.chStatusbar.setValue(state, true);
|
||||||
|
}, this)
|
||||||
|
},
|
||||||
|
'Toolbar': {
|
||||||
|
'view:compact': _.bind(function (toolbar, state) {
|
||||||
|
this.view.chToolbar.setValue(!state, true);
|
||||||
|
}, this)
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
|
Common.NotificationCenter.on('layout:changed', _.bind(this.onLayoutChanged, this));
|
||||||
|
|
|
@ -75,6 +75,12 @@ define([
|
||||||
this.cmbZoom.on('selected', function(combo, record) {
|
this.cmbZoom.on('selected', function(combo, record) {
|
||||||
me.fireEvent('viewtab:zoom', [record.value]);
|
me.fireEvent('viewtab:zoom', [record.value]);
|
||||||
});
|
});
|
||||||
|
this.chToolbar.on('change', function (field, value) {
|
||||||
|
me.fireEvent('viewtab:showtoolbar', [field, value !== 'checked']);
|
||||||
|
});
|
||||||
|
this.chStatusbar.on('change', function (field, value) {
|
||||||
|
me.fireEvent('statusbar:setcompact', [field, value === 'checked']);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -225,7 +231,7 @@ define([
|
||||||
this.chStatusbar = new Common.UI.CheckBox({
|
this.chStatusbar = new Common.UI.CheckBox({
|
||||||
el: $host.findById('#slot-chk-statusbar'),
|
el: $host.findById('#slot-chk-statusbar'),
|
||||||
labelText: this.textCombineSheetAndStatusBars,
|
labelText: this.textCombineSheetAndStatusBars,
|
||||||
value : true,
|
value : Common.localStorage.getBool('sse-compact-statusbar', true),
|
||||||
lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
|
lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'left',
|
dataHintDirection: 'left',
|
||||||
|
@ -236,7 +242,7 @@ define([
|
||||||
this.chToolbar = new Common.UI.CheckBox({
|
this.chToolbar = new Common.UI.CheckBox({
|
||||||
el: $host.findById('#slot-chk-toolbar'),
|
el: $host.findById('#slot-chk-toolbar'),
|
||||||
labelText: this.textAlwaysShowToolbar,
|
labelText: this.textAlwaysShowToolbar,
|
||||||
value : true,
|
value : !options.compactToolbar,
|
||||||
lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
|
lock : [_set.sheetLock, _set.lostConnect, _set.coAuth, _set.editCell],
|
||||||
dataHint : '1',
|
dataHint : '1',
|
||||||
dataHintDirection: 'left',
|
dataHintDirection: 'left',
|
||||||
|
|
Loading…
Reference in a new issue