Browse Source

Merge pull request #41 from yelizariev/9.0-mail_recovery-port

[PORT] port mail_recovery to 9.0
pull/42/head
Ivan Yelizariev 8 years ago
committed by GitHub
parent
commit
996c97b02e
  1. 6
      mail_recovery/README.rst
  2. 2
      mail_recovery/__openerp__.py
  3. 19
      mail_recovery/static/src/js/mail_recovery.js

6
mail_recovery/README.rst

@ -23,12 +23,12 @@ Sponsors
Further information Further information
=================== ===================
Demo: http://runbot.it-projects.info/demo/mail-addons/8.0
Demo: http://runbot.it-projects.info/demo/mail-addons/9.0
HTML Description: https://apps.odoo.com/apps/modules/8.0/mail_recovery/
HTML Description: https://apps.odoo.com/apps/modules/9.0/mail_recovery/
Usage instructions: `<doc/index.rst>`_ Usage instructions: `<doc/index.rst>`_
Changelog: `<doc/changelog.rst>`_ Changelog: `<doc/changelog.rst>`_
Tested on Odoo 8.0 17a130428516d9dd8105f90e8c9a65a0b4e8901b
Tested on Odoo 9.0 fd9eb2e4819031c6758c021f4c335b591367632d

2
mail_recovery/__openerp__.py

@ -13,5 +13,5 @@
'data': [ 'data': [
'data.xml', 'data.xml',
], ],
"installable": False,
"installable": True,
} }

19
mail_recovery/static/src/js/mail_recovery.js

@ -1,12 +1,11 @@
openerp.mail_recovery = function (session) {
var mail = session.mail;
odoo.define('mail_recovery', function (require) {
var composer = require('mail.composer');
mail.ThreadComposeMessage = mail.ThreadComposeMessage.extend({
bind_events: function () {
var self = this;
this.$('textarea').on('focus', self.on_focus_textarea);
this.$('textarea').on('keyup', self.on_keyup_textarea);
this._super();
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) { on_focus_textarea: function(event) {
var $input = $(event.target); var $input = $(event.target);
@ -17,9 +16,9 @@ openerp.mail_recovery = function (session) {
on_keyup_textarea: function(event) { on_keyup_textarea: function(event) {
window.localStorage['message_storage'] = $(event.target).val(); window.localStorage['message_storage'] = $(event.target).val();
}, },
on_message_post: function (event) {
send_message: function (event) {
window.localStorage['message_storage'] = ''; window.localStorage['message_storage'] = '';
return this._super(event); return this._super(event);
}, },
}); });
};
})
Loading…
Cancel
Save