File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change @@ -245,27 +245,24 @@ cls.ResourceManagerService = function(view, network_logger)
245245 return this . _context ;
246246 } ;
247247
248-
249248 this . get_resource = function ( id )
250249 {
251250 var ctx = this . _context ;
252- if ( ! ctx || ctx . _resourceHash [ id ] == null )
253- return null ;
251+ if ( ! ctx )
252+ return null ;
254253
255- return ctx . resourceList [ ctx . _resourceHash [ id ] ] ;
254+ var resource = ctx . resourceList . filter ( function ( v ) { return v . id == id ; } ) ;
255+ return resource && resource . last ;
256256 } ;
257257
258-
259258 this . get_resource_for_url = function ( url )
260259 {
261- if ( ! this . _context )
262- return null ;
263-
264- var id = this . _context . resourcesUrlDict [ url ] ;
265- if ( id === undefined )
260+ var ctx = this . _context ;
261+ if ( ! ctx )
266262 return null ;
267263
268- return this . get_resource ( id ) ;
264+ var resource = ctx . resourceList . filter ( function ( v ) { return v . url == url ; } ) ;
265+ return resource && resource . last ;
269266 } ;
270267
271268 this . _fetch_resource_data = function ( callback , id , type )
@@ -295,8 +292,6 @@ cls.ResourceManagerService = function(view, network_logger)
295292 this . _view . update ( ) ;
296293 } . bind ( this ) ;
297294
298-
299-
300295 this . request_resource_for_url = function ( url , callback )
301296 {
302297 cls . ResourceRequest ( url , callback , data ) ;
You can’t perform that action at this time.
0 commit comments