blob: e4ff7b775ed8be402e49d909151d2f6d34bdb871 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
define([], function () { // ODOO: remove error from Odoo define
var HelpDialog = function (handler) {
/**
* show help dialog
*
* @param {jQuery} $editable
* @param {jQuery} $dialog
* @return {Promise}
*/
this.showHelpDialog = function ($editable, $dialog) {
return $.Deferred(function (deferred) {
var $helpDialog = $dialog.find('.note-help-dialog');
$helpDialog.one('hidden.bs.modal', function () {
deferred.resolve();
}).modal('show');
}).promise();
};
/**
* @param {Object} layoutInfo
*/
this.show = function (layoutInfo) {
var $dialog = layoutInfo.dialog(),
$editable = layoutInfo.editable();
handler.invoke('editor.saveRange', $editable, true);
this.showHelpDialog($editable, $dialog).then(function () {
handler.invoke('editor.restoreRange', $editable);
});
};
};
return HelpDialog;
});
|