[IMP] persistence of dialog opt out

bzr revid: fme@openerp.com-20130924102305-dxyxq56imz1xeul8
This commit is contained in:
Fabien Meghazi 2013-09-24 12:23:05 +02:00
parent f46550fa27
commit bcd3f471ad
1 changed files with 3 additions and 1 deletions

View File

@ -3,6 +3,7 @@
var website = openerp.website;
website.templates.push('/website/static/src/xml/website.translator.xml');
var nodialog = 'website_translator_nodialog';
website.EditorBar.include({
start: function () {
@ -17,10 +18,11 @@
},
edit: function () {
var self = this;
if (!localStorage['website_translator_nodialog']) {
if (!localStorage[nodialog]) {
var dialog = new website.TranslatorDialog();
dialog.appendTo($(document.body));
dialog.on('activate', this, function () {
localStorage[nodialog] = dialog.$('input[name=do_not_show]').prop('checked') || '';
dialog.$el.modal('hide');
this.translate();
});