mirror of
https://github.com/Esri/offline-editor-js.git
synced 2025-12-15 15:20:05 +00:00
general code cleanup
This commit is contained in:
parent
f9faf2f22b
commit
15e0c52f14
@ -55,7 +55,7 @@ define([
|
||||
|
||||
if( !this._checkFileAPIs())
|
||||
{
|
||||
return callback(false, "File APIs not supported");
|
||||
return callback(false, "File APIs not supported");
|
||||
}
|
||||
|
||||
try
|
||||
@ -121,8 +121,6 @@ define([
|
||||
- what if the user deletes an offline feature that had offline attachments? we need to discard the attachment (DONE)
|
||||
|
||||
pending tasks:
|
||||
- delete attachment (DONE)
|
||||
- send attachments to server when reconnecting (DONE)
|
||||
- check for hasAttachments attribute in the FeatureLayer (NOT YET)
|
||||
*/
|
||||
|
||||
@ -487,10 +485,10 @@ define([
|
||||
"geometryType": geometryType
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
callback(featureDefinition);
|
||||
}
|
||||
};
|
||||
|
||||
/* internal methods */
|
||||
|
||||
@ -880,7 +878,7 @@ define([
|
||||
|
||||
// If the layer has attachments then check to see if the attachmentsStore has been initialized
|
||||
if (attachmentsStore == null && layer.hasAttachments) {
|
||||
console.log("ERROR: you need to run OfflineFeaturesManager.initAttachments(). Check the Attachments doc for more info.")
|
||||
console.log("ERROR: you need to run OfflineFeaturesManager.initAttachments(). Check the Attachments doc for more info.");
|
||||
throw new Error("OfflineFeaturesManager: Attachments aren't initialized.");
|
||||
}
|
||||
|
||||
@ -971,9 +969,9 @@ define([
|
||||
if (responses.hasOwnProperty(key)) {
|
||||
|
||||
var edit = responses[key];
|
||||
var tempResult = {};
|
||||
|
||||
if(edit.updateResults.length > 0){
|
||||
var tempResult = {};
|
||||
tempResult.layer = edit.layer;
|
||||
tempResult.id = edit.updateResults[0].objectId;
|
||||
editsArray.push(tempResult);
|
||||
@ -982,7 +980,6 @@ define([
|
||||
}
|
||||
}
|
||||
if(edit.deleteResults.length > 0){
|
||||
var tempResult = {};
|
||||
tempResult.layer = edit.layer;
|
||||
tempResult.id = edit.deleteResults[0].objectId;
|
||||
editsArray.push(tempResult);
|
||||
@ -991,7 +988,6 @@ define([
|
||||
}
|
||||
}
|
||||
if(edit.addResults.length > 0){
|
||||
var tempResult = {};
|
||||
tempResult.layer = edit.layer;
|
||||
tempResult.id = edit.tempId;
|
||||
editsArray.push(tempResult);
|
||||
@ -1034,7 +1030,7 @@ define([
|
||||
_updateDatabase: function(edit){
|
||||
var dfd = new Deferred();
|
||||
var fakeGraphic = {};
|
||||
fakeGraphic.attributes = {}
|
||||
fakeGraphic.attributes = {};
|
||||
fakeGraphic.attributes.objectid = edit.id;
|
||||
|
||||
this._editStore.delete(edit.layer,fakeGraphic,function(success,error){
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user