[FIX] necessary widget implementation

``inline`` is now automatically inferred on a per-widget basis if not
specified.

``inline`` true|false tells the widget whether it should work on
inlines (e.g. span) or blocks (e.g. p). Specifying the wrong one blows
up because the wrapper is incorrect (inline==false on an inline
element will wrap it in a div and add linefeeds, inline==true on a
block element will wrap it in a span which will automatically split up
in multiple elements leading to downcast blowing up because the wrong
wrapper will be selected).

Since last time, inline inference was added: if *unspecified* widget
will check what type of object it's called on (using
``CKEDITOR.dtd.$inline``) and generate the correct wrapper for that
type.

=> fix misbehavior by removing explicit inline spec.

Also remove unused init and data methods.

bzr revid: xmo@openerp.com-20130909152312-1m5kwvgw04gcrfkv
This commit is contained in:
Xavier Morel
2013-09-09 17:23:12 +02:00
parent 2cbfb88437
commit ca40afd144
@@ -125,24 +125,8 @@
init: function (editor) {
editor.widgets.add('oeref', {
inline: true,
// dialog: 'oeref',
allowedContent: '[data-oe-type]',
editables: { text: '*' },
init: function () {
var element = this.element;
this.setData({
model: element.data('oe-model'),
id: parseInt(element.data('oe-id'), 10),
field: element.data('oe-field'),
});
},
data: function () {
this.element.data('oe-model', this.data.model);
this.element.data('oe-id', this.data.id);
this.element.data('oe-field', this.data.field);
},
upcast: function (el) {
return el.attributes['data-oe-type'];
},