bzr revid: nicolas.vanhoren@openerp.com-20110628150016-nw2ft9g7v3ornw6y
This commit is contained in:
niv-openerp 2011-06-28 17:00:16 +02:00
commit 3d81e16e9b
2 changed files with 12 additions and 17 deletions

View File

@ -11,8 +11,8 @@ openerp.base.callback = function(obj, method) {
for(var i = 0; i < callback.callback_chain.length; i++) {
var c = callback.callback_chain[i];
if(c.unique) {
// al: obscure but shortening C-style hack, sorry
callback.callback_chain.pop(i--);
callback.callback_chain.splice(i, 1);
i -= 1;
}
r = c.callback.apply(c.self, c.args.concat(args));
// TODO special value to stop the chain
@ -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

View File

@ -135,7 +135,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()
@ -356,16 +356,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 }));