Skip to content
This repository has been archived by the owner on Apr 17, 2019. It is now read-only.

Commit

Permalink
Bug 869382: Check for activate/deactivate in retranslation management…
Browse files Browse the repository at this point in the history
…; r=stas
  • Loading branch information
Zbigniew Braniecki committed Jun 6, 2013
1 parent 335b66f commit 460a667
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/l20n/retranslation.js
Expand Up @@ -64,6 +64,9 @@ define(function (require, exports, module) {
if (get.globals.length != 0) {
_usage.push(get);
get.globals.forEach(function(id) {
if (!this.globals[i].activate) {
return;
}
_counter[id]++;
this.globals[id].activate();
}, this);
Expand All @@ -73,7 +76,7 @@ define(function (require, exports, module) {
// because we're just adding new entities to the bind
bound.callback = get.callback;
var added = get.globals.filter(function(id) {
return bound.globals.indexOf(id) === -1;
return this.globals[id].activate && bound.globals.indexOf(id) === -1;
});
added.forEach(function(id) {
_counter[id]++;
Expand All @@ -86,14 +89,14 @@ define(function (require, exports, module) {
} else {
// see which globals were added and which ones were removed
var added = get.globals.filter(function(id) {
return bound.globals.indexOf(id) === -1;
return this.globals[id].activate && bound.globals.indexOf(id) === -1;
});
added.forEach(function(id) {
_counter[id]++;
this.globals[id].activate();
}, this);
var removed = bound.globals.filter(function(id) {
return get.globals.indexOf(id) === -1;
return this.globals[id].deactivate && get.globals.indexOf(id) === -1;
});
removed.forEach(function(id) {
_counter[id]--;
Expand Down

0 comments on commit 460a667

Please sign in to comment.