mirror of
https://github.com/pcottle/learnGitBranching.git
synced 2025-06-28 08:50:06 +02:00
fixed all tests with weird function scoping bug
This commit is contained in:
parent
36161d3406
commit
dd4bec0597
6 changed files with 37 additions and 18 deletions
|
@ -41,7 +41,11 @@ var init = function() {
|
|||
wait: true
|
||||
});
|
||||
|
||||
LocaleStore.subscribe(intlRefresh);
|
||||
LocaleStore.subscribe(function() {
|
||||
if (LocaleStore.getLocale() !== LocaleStore.getDefaultLocale()) {
|
||||
intlRefresh();
|
||||
}
|
||||
});
|
||||
events.on('vcsModeChange', vcsModeRefresh);
|
||||
|
||||
initRootEvents(eventBaton);
|
||||
|
@ -64,7 +68,6 @@ var vcsModeRefresh = function(eventData) {
|
|||
};
|
||||
|
||||
var intlRefresh = function() {
|
||||
console.log('refreshing inlt');
|
||||
if (!window.$) { return; }
|
||||
$('span.intl-aware').each(function(i, el) {
|
||||
var intl = require('../intl');
|
||||
|
|
|
@ -30,6 +30,7 @@ var toGlobalize = {
|
|||
LevelDropdownView: require('../views/levelDropdownView'),
|
||||
BuilderViews: require('../views/builderViews'),
|
||||
LevelArbiter: require('../level/arbiter'),
|
||||
Util: require('../util/index'),
|
||||
Intl: require('../intl')
|
||||
};
|
||||
|
||||
|
|
|
@ -69,11 +69,16 @@ var LevelDropdownView = ContainedBase.extend({
|
|||
title: intl.str('select-a-level')
|
||||
});
|
||||
|
||||
// Lol WTF. For some reason we cant use this.render.bind(this) so
|
||||
// instead setup a lame callback version. The CasperJS tests
|
||||
// fail otherwise.
|
||||
var that = this;
|
||||
LocaleStore.subscribe(function() {
|
||||
that.render.apply(that);
|
||||
});
|
||||
this.render();
|
||||
|
||||
Main.getEvents().on('resetMapSolved', this.render, this);
|
||||
LocaleStore.subscribe(this.render.bind(this));
|
||||
|
||||
if (!options.wait) {
|
||||
this.show();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue