File uploader updates
This commit is contained in:
@@ -4,15 +4,19 @@ $('#dataform').on('submit', function (e) {
|
||||
|
||||
var inputContent = $.trim( $('#data').val() );
|
||||
|
||||
if ( document.getElementById("fileUpload").files.length > 0 ) {
|
||||
getFileContents( document.getElementById("fileUpload").files[0] );
|
||||
}
|
||||
else if (inputContent.length > 0) {
|
||||
if (inputContent.length > 0) {
|
||||
var warData = JSON.parse( inputContent );
|
||||
initApp(warData, 'withSave', warData);
|
||||
}
|
||||
});
|
||||
|
||||
$('#fileUpload').on('change', function () {
|
||||
var fileUploader = document.getElementById("fileUpload");
|
||||
if ( fileUploader.files.length > 0 ) {
|
||||
getFileContents( fileUploader.files[0] );
|
||||
}
|
||||
});
|
||||
|
||||
function initApp (data, callback, callbackData) {
|
||||
if( !data.results ||
|
||||
!data.results[0] ||
|
||||
|
||||
@@ -34,4 +34,8 @@ header {
|
||||
margin-left: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
[type="file"] {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user