[REM] Removed trigger_children and trigger_ancestors from corelib.

niv is back from holidays, let's give him some time to accept the concept.
"the Seven Stages Of Grief".currentStage === 4

bzr revid: fme@openerp.com-20120906103852-mm8bo8tgzl8dtfnq
This commit is contained in:
Fabien Meghazi 2012-09-06 12:38:52 +02:00
parent c43e9bce27
commit c3f9e44aee
2 changed files with 14 additions and 20 deletions

View File

@ -958,6 +958,20 @@ instance.web.Client = instance.web.Widget.extend({
has_uncommitted_changes: function() {
return false;
},
trigger_children: function(events) {
// TODO: In the future, if we have more valid use cases in other objects, let's
// put this back in the EventDispatcherMixin as an option of trigger()
var children = this.getChildren();
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.__eventDispatcherMixin) {
child.__edispatcherEvents.trigger.apply(child.__edispatcherEvents, arguments);
instance.webclient // Yuck!
.trigger_children.apply(child, arguments);
}
}
return this;
},
});
instance.web.WebClient = instance.web.Client.extend({

View File

@ -359,26 +359,6 @@ instance.web.EventDispatcherMixin = _.extend({}, instance.web.ParentedMixin, {
this.__edispatcherEvents.trigger.apply(this.__edispatcherEvents, arguments);
return this;
},
trigger_children: function(events) {
var children = this.getChildren();
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.__eventDispatcherMixin) {
child.__edispatcherEvents.trigger.apply(child.__edispatcherEvents, arguments);
child.trigger_children.apply(child, arguments);
}
}
return this;
},
trigger_ancestors: function(events) {
var parent = this;
while (parent = parent.getParent()) {
parent.__edispatcherEvents.trigger.apply(parent.__edispatcherEvents, arguments);
parent.trigger_ancestors.apply(parent, arguments);
}
return this;
},
destroy: function() {
var self = this;
_.each(this.__edispatcherRegisteredEvents, function(event) {