summaryrefslogtreecommitdiff
path: root/addons/website/static/src/js/website.editor.js
diff options
context:
space:
mode:
authorXavier Morel <xmo@openerp.com>2013-12-03 12:13:23 +0100
committerXavier Morel <xmo@openerp.com>2013-12-03 12:13:23 +0100
commit9d9d3f207e7e6089d01f0b7fe26d7fd9cda0ddce (patch)
tree815a9a2c9a0aecc43c3c96b30c62b25a5d22233d /addons/website/static/src/js/website.editor.js
parentc86e61f8d9dcf5101ac5be4b22da2fbf5bc34185 (diff)
[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
Diffstat (limited to 'addons/website/static/src/js/website.editor.js')
-rw-r--r--addons/website/static/src/js/website.editor.js15
1 files changed, 14 insertions, 1 deletions
diff --git a/addons/website/static/src/js/website.editor.js b/addons/website/static/src/js/website.editor.js
index b5caac71d74..5128a3028ce 100644
--- a/addons/website/static/src/js/website.editor.js
+++ b/addons/website/static/src/js/website.editor.js
@@ -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();