[FIX] website editor: check if link and fa is editable and display change button
authorchm@openerp.com <>
Tue, 11 Mar 2014 13:08:52 +0000 (14:08 +0100)
committerchm@openerp.com <>
Tue, 11 Mar 2014 13:08:52 +0000 (14:08 +0100)
bzr revid: chm@openerp.com-20140311130852-3ft0v1mc9ht1any6

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

index f874a5c..a5cf89b 100644 (file)
@@ -54,7 +54,7 @@
      * is editable but its attributes should not be considered editable
      */
     function is_editable_node(element) {
-        return (element.data('oe-model') !== 'ir.ui.view'
+        return !(element.data('oe-model') === 'ir.ui.view'
               || element.data('cke-realelement')
               || (is_editing_host(element) && element.getAttribute('attributeEditable') !== 'true')
               || element.isReadOnly());
             var $link_button = this.make_hover_button(_t("Change"), function () {
                 var sel = new CKEDITOR.dom.element(previous);
                 editor.getSelection().selectElement(sel);
-                if (previous.tagName.toUpperCase() === 'A') {
-                    link_dialog(editor);
-                } else if(sel.hasClass('fa')) {
+                if(sel.hasClass('fa')) {
                     new website.editor.FontIconsDialog(editor, previous)
                         .appendTo(document.body);
+                } else if (previous.tagName.toUpperCase() === 'A') {
+                    link_dialog(editor);
                 }
                 $link_button.hide();
                 previous = null;