[FIX] warnings, typos, globals which should not be globals, and use jquery shortcuts when there is no reason not to

bzr revid: xmo@openerp.com-20110628142124-oexuucl4dpic6x1x
This commit is contained in:
Xavier Morel
2011-06-28 16:21:24 +02:00
parent 79a24bd46e
commit 62ef841b15
2 changed files with 10 additions and 15 deletions
+5 -6
View File
@@ -284,13 +284,12 @@ openerp.base.generate_null_object_class = function(claz, add) {
}
if (prototype.prototype)
copy_proto(prototype.prototype);
}
};
copy_proto(claz.prototype);
var init = openerp.base.BasicController.prototype.init;
newer.init = init;
newer.init = openerp.base.BasicController.prototype.init;
var tmpclass = claz.extend(newer);
return tmpclass.extend(add || {});
}
};
openerp.base.Notification = openerp.base.BasicController.extend({
init: function(element_id) {
@@ -580,7 +579,7 @@ openerp.base.Controller = openerp.base.BasicController.extend( /** @lends opener
*/
controller_get: function(key) {
return this.controller_registry[key];
// OR should contrustct it ? setting parent correctly ?
// OR should build it ? setting parent correctly ?
// function construct(constructor, args) {
// function F() {
// return constructor.apply(this, args);
@@ -640,7 +639,7 @@ openerp.base.Controller = openerp.base.BasicController.extend( /** @lends opener
}
// TODO if post prefix
//this.element_id = _.uniqueId(_.toArray(arguments).join('_'));
};
}
},
/**
* Performs a JSON-RPC call
+5 -9
View File
@@ -128,7 +128,7 @@ openerp.base.ViewManager = openerp.base.Controller.extend({
controller.set_embedded_view(view.embedded_view);
}
if (view_type === 'list' && this.flags.search_view === false && this.action && this.action['auto_search']) {
// In case the search view is not instanciated: manually call ListView#search
// In case the search view is not instantiated: manually call ListView#search
var domains = !_(self.action.domain).isEmpty()
? [self.action.domain] : [],
contexts = !_(self.action.context).isEmpty()
@@ -349,16 +349,12 @@ openerp.base.Sidebar = openerp.base.BaseWidget.extend({
},
do_refresh: function(new_view) {
var view = this.view_manager.active_view;
the_condition = this.sections.length > 0 && _.detect(this.sections,
var the_condition = this.sections.length > 0 && _.detect(this.sections,
function(x) {return x.elements.length > 0;}) != undefined
&& (!new_view || view != 'list');
if (!the_condition) {
this.$element.addClass('closed-sidebar');
this.$element.removeClass('open-sidebar');
} else {
this.$element.addClass('open-sidebar');
this.$element.removeClass('closed-sidebar');
}
this.$element.toggleClass('open-sidebar', the_condition)
.toggleClass('closed-sidebar', !the_condition);
this.$element.html(QWeb.render("ViewManager.sidebar.internal", { sidebar: this, view: view }));