fix js bug

This commit is contained in:
Connor Turland 2016-02-29 17:05:11 +13:00
parent c6fea78054
commit d50923b6bd
2 changed files with 5 additions and 6 deletions

View file

@ -48,6 +48,7 @@ $(document).ready(function () {
// this runs the init function within each sub-object on the Metamaps one // this runs the init function within each sub-object on the Metamaps one
if (Metamaps.hasOwnProperty(prop) && if (Metamaps.hasOwnProperty(prop) &&
Metamaps[prop] != null &&
Metamaps[prop].hasOwnProperty('init') && Metamaps[prop].hasOwnProperty('init') &&
typeof (Metamaps[prop].init) == 'function' typeof (Metamaps[prop].init) == 'function'
) { ) {

View file

@ -17,12 +17,10 @@ var labelType, useGradients, nativeTextSupport, animate;
})(); })();
// TODO eliminate these 4 top-level variables // TODO eliminate these 4 top-level variables
Metamaps = { Metamaps.panningInt = null;
panningInt: null, Metamaps.tempNode = null;
tempNode: null, Metamaps.tempInit = false;
tempInit: false, Metamaps.tempNode2 = null;
tempNode2: null
}
Metamaps.Settings = { Metamaps.Settings = {
embed: false, // indicates that the app is on a page that is optimized for embedding in iFrames on other web pages embed: false, // indicates that the app is on a page that is optimized for embedding in iFrames on other web pages