[IMP] website: media editor: add feedback when the user try to remove a picture
authorchm@openerp.com <>
Mon, 7 Apr 2014 07:32:47 +0000 (09:32 +0200)
committerchm@openerp.com <>
Mon, 7 Apr 2014 07:32:47 +0000 (09:32 +0200)
bzr revid: chm@openerp.com-20140407073247-davv0udxz5n5qx35

addons/website/static/src/js/website.editor.js

index 5ef5359..bd17584 100644 (file)
         try_remove: function (e) {
             var $help_block = this.$('.help-block').empty();
             var self = this;
-            var id = parseInt($(e.target).data('id'), 10);
+            var $a = $(e.target);
+            var id = parseInt($a.data('id'), 10);
             var attachment = _.findWhere(this.records, {id: id});
+            var $both = $a.parent().children();
+
+            $both.css({borderWidth: "5px", borderColor: "#f00"});
 
             return openerp.jsonRpc('/web/dataset/call_kw', 'call', {
                 model: 'ir.attachment',
                     self.display_attachments();
                     return;
                 }
+                $both.css({borderWidth: "", borderColor: ""});
                 $help_block.replaceWith(openerp.qweb.render(
                     'website.editor.dialog.image.existing.error', {
                         views: prevented[id]