You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
880 B
24 lines
880 B
odoo.define('mail_recovery', function (require) {
|
|
var composer = require('mail.composer');
|
|
|
|
composer.BasicComposer.include({
|
|
init: function(){
|
|
this._super.apply(this, arguments);
|
|
this.events['focus .o_composer_input textarea'] = 'on_focus_textarea';
|
|
this.events['keyup .o_composer_input textarea'] = 'on_keyup_textarea';
|
|
},
|
|
on_focus_textarea: function(event) {
|
|
var $input = $(event.target);
|
|
if (!$input.val()) {
|
|
$input.val(window.localStorage.message_storage);
|
|
}
|
|
},
|
|
on_keyup_textarea: function(event) {
|
|
window.localStorage.message_storage = $(event.target).val();
|
|
},
|
|
send_message: function (event) {
|
|
window.localStorage.message_storage = '';
|
|
return this._super(event);
|
|
},
|
|
});
|
|
});
|