[FIX] website: prevent t-field on selection fields
authorAjay Patel <apa@openerp.com>
Fri, 5 Sep 2014 09:47:58 +0000 (15:17 +0530)
committerRichard Mathot <rim@openerp.com>
Thu, 25 Sep 2014 08:43:55 +0000 (10:43 +0200)
This quick fix avoids a buggy behaviour in version 8.0 that could
confuse users.

A future version should implement properly selection fields in t-field.

(closes #2490)

(cherry picked from commit fe3cac30e4c5c132da1de02576d4aa325979ccd9)

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

index 50c939a..ee6368e 100644 (file)
             var def = $.Deferred();
             var editor = this.editor = CKEDITOR.inline(root, self._config());
             editor.on('instanceReady', function () {
+                $("[data-oe-type=selection]").attr("contenteditable",false);
                 editor.setReadOnly(false);
                 // ckeditor set root to editable, disable it (only inner
                 // sections are editable)
 
         fetch_editables: function (root) {
             return $(root).find('[data-oe-model]')
+                .not('[data-oe-type = "selection"]')
                 .not('link, script')
                 .not('.oe_snippet_editor')
                 .filter(function () {