mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
minor code rearrangement
This commit is contained in:
parent
bf55ec70a8
commit
bee76389d1
@ -171,6 +171,7 @@ require([
|
||||
function(Map,Query,FeatureLayer,OfflineFeaturesManager,editsStore,AppCacheManager,AttributeInspector,domConstruct,on,dom,Button,SimpleTextArea) {
|
||||
|
||||
var textTimer;
|
||||
var appCacheManager;
|
||||
var offlineFeaturesManager;
|
||||
var map,busStopsFeatureLayer,currentFeature;
|
||||
var imgOfflineIndicator,btnOnlineOffline;
|
||||
@ -200,12 +201,6 @@ require([
|
||||
|
||||
map.addLayers([busStopsFeatureLayer]);
|
||||
|
||||
function initAppCacheManager(){
|
||||
appCacheManager = new AppCacheManager(true,true);
|
||||
appCacheManager.on(appCacheManager.CACHE_EVENT,cacheEventHandler);
|
||||
appCacheManager.on(appCacheManager.CACHE_ERROR,cacheErrorHandler);
|
||||
}
|
||||
|
||||
function initOffline(){
|
||||
offlineFeaturesManager = new OfflineFeaturesManager();
|
||||
offlineFeaturesManager.on(offlineFeaturesManager.events.EDITS_ENQUEUED, updateStatus);
|
||||
@ -222,6 +217,13 @@ require([
|
||||
on(dom.byId('btn-online-offline'), 'click', goOnlineOffline);
|
||||
}
|
||||
|
||||
function initAppCacheManager(){
|
||||
appCacheManager = new AppCacheManager(true,true);
|
||||
appCacheManager.on(appCacheManager.CACHE_EVENT,cacheEventHandler);
|
||||
appCacheManager.on(appCacheManager.CACHE_ERROR,cacheErrorHandler);
|
||||
appCacheManager.on(appCacheManager.CACHE_LOADED,cacheLoadedHandler);
|
||||
}
|
||||
|
||||
function initEditing(evt){
|
||||
|
||||
offlineFeaturesManager.extend(busStopsFeatureLayer);
|
||||
@ -346,6 +348,10 @@ require([
|
||||
}
|
||||
}
|
||||
|
||||
function cacheLoadedHandler(evt){
|
||||
if(evt == appCacheManager.CACHE_LOADED) console.log("Application cache successfully loaded!")
|
||||
}
|
||||
|
||||
function cacheEventHandler(evt){
|
||||
console.log("CACHE EVENT: " + JSON.stringify(evt));
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user