Commit 0b13fec44be30f1665656f64f3cc855c2c50f401

Authored by Nikita Kulshreshtha
2 parents 8e43c571 213e81e9

Merge branch 'RefactorCodeForFontFamily' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
@@ -149,7 +149,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -149,7 +149,7 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
149 //theme:"rounded" 149 //theme:"rounded"
150 }); 150 });
151 } 151 }
152 - $rootScope.isFontFamilyLoaded = true; 152 + $rootScope.isFontFamilyLoaded = false;
153 //annotation tool custom events 153 //annotation tool custom events
154 $rootScope.ShowAnnotationWindow = function () { 154 $rootScope.ShowAnnotationWindow = function () {
155 //7904 155 //7904
@@ -165,26 +165,30 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location", @@ -165,26 +165,30 @@ AIA.controller("HomeController", ["$rootScope", "Modules", "$log", "$location",
165 $("#canvas").css("display", "none"); 165 $("#canvas").css("display", "none");
166 166
167 var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json'; 167 var FontFamilyJson = '~/../content/data/json/settings/fontstyle.json';
168 - DataService.getJson(FontFamilyJson) 168 + if ($rootScope.isFontFamilyLoaded == false) {
  169 +
  170 +
  171 + DataService.getJson(FontFamilyJson)
169 .then( 172 .then(
170 function (result) { 173 function (result) {
171 174
172 $rootScope.AnnotationFontFamily = result; 175 $rootScope.AnnotationFontFamily = result;
173 - // alert($rootScope.AnnotationFontFamily.FontStyle.length);  
174 - if ($rootScope.isFontFamilyLoaded == true)  
175 - for (var i = 0; i <= $rootScope.AnnotationFontFamily.FontFamily.length - 1; i++)  
176 - {  
177 -  
178 - $("#selected-font-family").append("<option>" + $rootScope.AnnotationFontFamily.FontFamily[i].FontName + "</option>");  
179 - $rootScope.isFontFamilyLoaded = false; 176 + // alert($rootScope.AnnotationFontFamily.FontStyle.length);
  177 +
  178 + for (var i = 0; i <= $rootScope.AnnotationFontFamily.FontFamily.length - 1; i++) {
  179 +
  180 + $("#selected-font-family").append("<option>" + $rootScope.AnnotationFontFamily.FontFamily[i].FontName + "</option>");
  181 +
180 } 182 }
181 - 183 + $rootScope.isFontFamilyLoaded = true;
  184 +
182 }, 185 },
183 function (error) { 186 function (error) {
184 console.log(error.statusText) 187 console.log(error.statusText)
185 } 188 }
186 ) 189 )
187 190
  191 + }
188 192
189 } 193 }
190 194