Sfoglia il codice sorgente

Try if is possible load a resource

@soyjavi 14 anni fa
parent
commit
5ca70a8003
2 ha cambiato i file con 9 aggiunte e 3 eliminazioni
  1. 3 1
      src/Lungo.Constants.js
  2. 6 2
      src/boot/Lungo.Boot.Resources.js

+ 3 - 1
src/Lungo.Constants.js

@@ -45,6 +45,7 @@ LUNGO.Constants = {
         WIDTH: 'width',
         HEIGHT: 'height',
         PIXEL: 'px',
+        PERCENT: '%',
         TARGET: 'target',
         FIRST: 'first',
         LAST: 'last'
@@ -63,7 +64,8 @@ LUNGO.Constants = {
         BINDING_TEMPLATE: 'ERROR: Binding Template not exists >> ',
         BINDING_LIST: 'ERROR: Processing parameters for list binding.',
         DATABASE: 'ERROR: Connecting to Data.Sql.',
-        ROUTER: 'ERROR: The target does not exists >>'
+        ROUTER: 'ERROR: The target does not exists >>',
+        LOADING_RESOURCE: 'ERROR: Loading resource.'
     }
 
 };

+ 6 - 2
src/boot/Lungo.Boot.Resources.js

@@ -34,9 +34,13 @@ LUNGO.Boot.Resources = (function(lng, $$, undefined) {
     var _loadResources = function(resource_key, resources, callback) {
         for (index in resources) {
             var url = _parseUrl(resources[index], resource_key);
-            var response = _loadAsyncResource(url);
 
-            _factoryResources(resource_key, response);
+            try {
+                var response = _loadAsyncResource(url);
+                _factoryResources(resource_key, response);
+            } catch(error) {
+                lng.Core.log(3, ERROR.LOADING_RESOURCE + ' ' + error);
+            }
         }
     };