[IMP] cancellation of RTE

* rename Cancel to Discard for clarity (user test)

* add intermediate dialog in case of mis-click, use 'danger' button
  style to clearly indicate this is a destructive operation

bzr revid: xmo@openerp.com-20131203111323-9mx7aazfpsybe718
This commit is contained in:
Xavier Morel
2013-12-03 12:13:23 +01:00
parent c86e61f8d9
commit 9d9d3f207e
2 changed files with 39 additions and 2 deletions
+14 -1
View File
@@ -555,7 +555,20 @@
});
},
cancel: function () {
website.reload();
new $.Deferred(function (d) {
var $dialog = $(openerp.qweb.render('website.editor.discard')).appendTo(document.body);
$dialog.on('click', '.btn-danger', function () {
d.resolve();
}).on('hidden.bs.modal', function () {
d.reject();
});
d.always(function () {
$dialog.remove();
});
$dialog.modal('show');
}).then(function () {
website.reload();
})
},
new_page: function (ev) {
ev.preventDefault();