Skip to content

Commit

Permalink
Merged issue-127 to master. Resolution of issue softwareloop#127.
Browse files Browse the repository at this point in the history
  • Loading branch information
softwareloop committed Jul 19, 2018
2 parents 81ef0c4 + f50b497 commit 0d10470
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions surf/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
/.settings/
*.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@
return;
}

if (!this.shouldUseSameMetadataSet) {
this.cleanupOldFormForNextUpload();
}

if (this.showConfig.mode === this.MODE_SINGLE_UPDATE) {
Alfresco.logger.debug("Single update");
return SoftwareLoop.DNDUpload.superclass._spawnUploads.call(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,11 @@
Alfresco.logger.debug("show", arguments);

SoftwareLoop.FlashUpload.superclass.show.call(this, config);


if (!this.shouldUseSameMetadataSet) {
this.cleanupOldFormForNextUpload();
}

this.loadTypes(this.populateSelect, this);
Alfresco.logger.debug("END show");
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@

SoftwareLoop.HtmlUpload.superclass.show.call(this, config);

if (!this.shouldUseSameMetadataSet) {
this.cleanupOldFormForNextUpload();
}

this.loadTypes(function () {
Alfresco.logger.debug("loadTypes callback");
this.populateSelect();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,8 @@
delete fileInfo.propertyData.prop_cm_name;
}
}while((++this.currentRecordIndex<this.records.length) && this.shouldUseSameMetadataSet);

this.cleanupOldFormForNextUpload();
this.showMetadataDialog();
} else {
Alfresco.logger.debug("Form with errors");
Expand Down Expand Up @@ -368,6 +370,7 @@
var propertyData = formRuntime._buildAjaxForSubmit(form);
propertyData.contentType = contentType;
this.fileStore[data.id].propertyData = propertyData;

Alfresco.logger.debug("END processMetadata", propertyData);
},

Expand Down Expand Up @@ -401,7 +404,17 @@
Alfresco.logger.debug("centerPanel", arguments);
this.getPanel().center();
Alfresco.logger.debug("END centerPanel");
},

/**
* Metadata form might already have some leftovers, clean up old form HTML for next upload
*/
cleanupOldFormForNextUpload: function() {
var formHtmlId = this.id + "-metadata-form";
var formNode = YAHOO.util.Dom.get(formHtmlId);
while (formNode.hasChildNodes()) {
formNode.removeChild(formNode.lastChild);
}
}

};
})();

0 comments on commit 0d10470

Please sign in to comment.