* handles editability case for lists, because it depends on form and forms already depends on lists it had to be split out
* @namespace
*/
-openerp.web.list_editable = function (instance) {
+(function() {
+
+ var instance = openerp;
+ openerp.web.list_editable = {};
var _t = instance.web._t;
// editability status of list rows
make_empty_record: function (id) {
var attrs = {id: id};
_(this.columns).chain()
- .filter(function (x) { return x.tag === 'field'})
+ .filter(function (x) { return x.tag === 'field';})
.pluck('name')
.each(function (field) { attrs[field] = false; });
return new instance.web.list.Record(attrs);
get_cells_for: function ($row) {
var cells = {};
$row.children('td').each(function (index, el) {
- cells[el.getAttribute('data-field')] = el
+ cells[el.getAttribute('data-field')] = el;
});
return cells;
},
var record = self.records.get(attrs.id);
if (!record) {
// Record removed by third party during edition
- return
+ return;
}
return self.reload_record(record);
}
};
} else if (document.body.createTextRange) {
throw new Error("Implement text range handling for MSIE");
- var sel = document.body.createTextRange();
- if (sel.parentElement() === el) {
-
- }
}
// Element without selection ranges (select, div/@contenteditable)
return null;
var arch = edition_view.arch;
if (!(arch && arch.children instanceof Array)) {
throw new Error("Editor delegate's #edition_view must have a" +
- " non-empty arch")
+ " non-empty arch");
}
- if (!(arch.tag === "form")) {
+ if (arch.tag !== "form") {
throw new Error("Editor delegate's #edition_view must have a" +
" 'form' root node");
}
return null;
}
});
-};
+})();