[desktop] connection hints with app

This commit is contained in:
Maxim Kadushkin 2022-05-24 00:13:42 +03:00
parent 1817bb2142
commit 1f15df4fee
2 changed files with 16 additions and 3 deletions

View file

@ -137,6 +137,10 @@ define([
if (!!_mr[1]) $('#app-title').show();
else if (!!_mr[2]) $('#app-title').hide();
}
} else
if (/althints:show/.test(cmd)) {
if ( param == /false|hide/.test(param) )
Common.NotificationCenter.trigger('hints:clear');
}
};
@ -187,6 +191,10 @@ define([
}
};
var _onHintsShow = function (visible, level) {
native.execCommand('althints:show', JSON.stringify(visible && !(level > 0)));
}
return {
init: function (opts) {
_.extend(config, opts);
@ -256,12 +264,13 @@ define([
Common.NotificationCenter.on({
'modal:show': _onModalDialog.bind(this, 'open'),
'modal:close': _onModalDialog.bind(this, 'close')
, 'uitheme:changed' : function (name) {
'modal:close': _onModalDialog.bind(this, 'close'),
'uitheme:changed' : function (name) {
var theme = Common.UI.Themes.get(name);
if ( theme )
native.execCommand("uitheme:changed", JSON.stringify({name:name, type:theme.type}));
}
},
'hints:show': _onHintsShow.bind(this),
});
webapp.addListeners({

View file

@ -171,6 +171,8 @@ Common.UI.HintManager = new(function() {
} else {
_hintVisible = false;
}
Common.NotificationCenter.trigger('hints:show', _hintVisible, _currentLevel);
};
var _hideHints = function() {
@ -179,6 +181,8 @@ Common.UI.HintManager = new(function() {
item.remove()
});
clearInterval(_inputTimer);
Common.NotificationCenter.trigger('hints:show', false);
};
var _nextLevel = function(level) {