diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index dbcf383..37bccd2 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -149,7 +149,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", //theme:"rounded" }); } - $rootScope.isFontFamilyLoaded = true; + $rootScope.isFontFamilyLoaded = false; //annotation tool custom events $rootScope.ShowAnnotationWindow = function () { //7904 @@ -165,26 +165,30 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", $("#canvas").css("display", "none"); var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json'; - DataService.getJson(FontFamilyJson) + if ($rootScope.isFontFamilyLoaded == false) { + + + DataService.getJson(FontFamilyJson) .then( function (result) { $rootScope.AnnotationFontFamily = result; - // alert($rootScope.AnnotationFontFamily.FontStyle.length); - if ($rootScope.isFontFamilyLoaded == true) - for (var i = 0; i <= $rootScope.AnnotationFontFamily.FontFamily.length - 1; i++) - { - - $("#selected-font-family").append(""); - $rootScope.isFontFamilyLoaded = false; + // alert($rootScope.AnnotationFontFamily.FontStyle.length); + + for (var i = 0; i <= $rootScope.AnnotationFontFamily.FontFamily.length - 1; i++) { + + $("#selected-font-family").append(""); + } - + $rootScope.isFontFamilyLoaded = true; + }, function (error) { console.log(error.statusText) } ) + } }