* Improve the use of _.extend to merge a defined set of keys into a dict, rather than do it via []
* Array() should be newed
* Removed redundant variable (assignment to self)
* Remember to use hasOwnProperty when iterating on an object's properties
bzr revid: xmo@openerp.com-
20110628060934-sh43wku6go3miwce
});
}
view_promise = controller.start();
});
}
view_promise = controller.start();
$.when(view_promise).then(function() {
self.on_controller_inited(view_type, controller);
});
$.when(view_promise).then(function() {
self.on_controller_inited(view_type, controller);
});
.filter('[data-view-type="' + view_type + '"]')
.attr('disabled', true);
.filter('[data-view-type="' + view_type + '"]')
.attr('disabled', true);
- for (var i in this.views) {
- if (this.views[i].controller) {
- if (i === view_type) {
- $.when(view_promise).then(this.views[i].controller.do_show);
+ for (var view_name in this.views) {
+ if (!this.views.hasOwnProperty(view_name)) { continue; }
+ if (this.views[view_name].controller) {
+ if (view_name === view_type) {
+ $.when(view_promise).then(this.views[view_name].controller.do_show);
- this.views[i].controller.do_hide();
+ this.views[view_name].controller.do_hide();
var action = r.result;
if (action && action.constructor == Object) {
action.context = action.context || {};
var action = r.result;
if (action && action.constructor == Object) {
action.context = action.context || {};
- action.context['active_id'] = dataset.ids[dataset.index];
- action.context['active_ids'] = [dataset.ids[dataset.index]];
- action.context['active_model'] = dataset.model;
- _.extend(action.context, dataset.context);
+ _.extend(action.context, {
+ active_id: dataset.ids[dataset.index],
+ active_ids: [dataset.ids[dataset.index]],
+ active_model: dataset.model
+ }, dataset.context);
action.flags = {
sidebar : false,
search_view : false,
action.flags = {
sidebar : false,
search_view : false,
throw("Node a json node");
}
indent = indent || 0;
throw("Node a json node");
}
indent = indent || 0;
- var sindent = Array(indent + 1).join('\t'),
+ var sindent = new Array(indent + 1).join('\t'),
r = sindent + '<' + node.tag;
for (var attr in node.attrs) {
var vattr = node.attrs[attr];
r = sindent + '<' + node.tag;
for (var attr in node.attrs) {
var vattr = node.attrs[attr];