mirror of
https://github.com/ONLYOFFICE/web-apps.git
synced 2026-07-24 06:08:33 +08:00
[desktop] send 'quickaccess:changed' message to native
This commit is contained in:
@ -463,6 +463,9 @@ define([
|
||||
if (!!header.btnRedo)
|
||||
titlebuttons['redo'] = {btn: header.btnRedo};
|
||||
|
||||
if (!!header.btnQuickAccess)
|
||||
titlebuttons['quickaccess'] = {btn: header.btnQuickAccess};
|
||||
|
||||
for (var i in titlebuttons) {
|
||||
titlebuttons[i].btn.options.signals = ['disabled'];
|
||||
titlebuttons[i].btn.on('disabled', _onTitleButtonDisabled.bind(this, i));
|
||||
@ -519,6 +522,10 @@ define([
|
||||
console.log('open recent');
|
||||
}
|
||||
|
||||
const _onChangeQuickAccess = function (props) {
|
||||
native.execCommand("quickaccess:changed", JSON.stringify(props));
|
||||
}
|
||||
|
||||
const _extend_menu_file = function (args) {
|
||||
console.log('extend menu file')
|
||||
|
||||
@ -576,6 +583,7 @@ define([
|
||||
}
|
||||
},
|
||||
'hints:show': _onHintsShow.bind(this),
|
||||
'quickaccess:changed': _onChangeQuickAccess.bind(this),
|
||||
});
|
||||
|
||||
webapp.addListeners({
|
||||
|
||||
@ -311,7 +311,7 @@ define([
|
||||
}
|
||||
}
|
||||
|
||||
function onChangeQuickAccess(props) {
|
||||
function onChangeQuickAccess(caller, props) {
|
||||
if (props.save !== undefined) {
|
||||
this.btnSave[props.save ? 'show' : 'hide']();
|
||||
Common.localStorage.setBool(this.appPrefix + 'quick-access-save', props.save);
|
||||
@ -333,6 +333,9 @@ define([
|
||||
Common.localStorage.setBool(this.appPrefix + 'quick-access-redo', props.redo);
|
||||
}
|
||||
Common.NotificationCenter.trigger('edit:complete');
|
||||
|
||||
if ( caller && caller == 'header' )
|
||||
Common.NotificationCenter.trigger('quickaccess:changed', props);
|
||||
}
|
||||
|
||||
function onAppReady(mode) {
|
||||
@ -530,9 +533,9 @@ define([
|
||||
props.redo = item.checked;
|
||||
break;
|
||||
}
|
||||
onChangeQuickAccess.call(me, props);
|
||||
onChangeQuickAccess.call(me, 'header', props);
|
||||
});
|
||||
Common.NotificationCenter.on('quickaccess:changed', onChangeQuickAccess.bind(me));
|
||||
Common.NotificationCenter.on('quickaccess:changed', onChangeQuickAccess.bind(me, 'settings'));
|
||||
}
|
||||
|
||||
if ( !appConfig.twoLevelHeader ) {
|
||||
|
||||
Reference in New Issue
Block a user