|
|
@ -175,29 +175,43 @@ define([
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$label.click(function () {
|
|
|
|
var todo = function () {
|
|
|
|
$form.find('input[type="file"]').click();
|
|
|
|
$label.click(function () {
|
|
|
|
});
|
|
|
|
$form.find('input[type="file"]').click();
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
$form.css({
|
|
|
|
$form.css({
|
|
|
|
display: 'block',
|
|
|
|
display: 'block',
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
var fmConfig = {
|
|
|
|
var fmConfig = {
|
|
|
|
dropArea: $form,
|
|
|
|
dropArea: $form,
|
|
|
|
hoverArea: $label,
|
|
|
|
hoverArea: $label,
|
|
|
|
body: $body,
|
|
|
|
body: $body,
|
|
|
|
keepTable: true // Don't fadeOut the table with the uploaded files
|
|
|
|
keepTable: true // Don't fadeOut the table with the uploaded files
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var FM = common.createFileManager(fmConfig);
|
|
|
|
var FM = common.createFileManager(fmConfig);
|
|
|
|
|
|
|
|
|
|
|
|
$form.find("#cp-app-file-upfile").on('change', function (e) {
|
|
|
|
$form.find("#cp-app-file-upfile").on('change', function (e) {
|
|
|
|
var file = e.target.files[0];
|
|
|
|
var file = e.target.files[0];
|
|
|
|
FM.handleFile(file);
|
|
|
|
FM.handleFile(file);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
UI.removeLoadingScreen();
|
|
|
|
UI.removeLoadingScreen();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var checkOnline = function () {
|
|
|
|
|
|
|
|
var priv = metadataMgr.getPrivateData();
|
|
|
|
|
|
|
|
if (priv.offline) { return; }
|
|
|
|
|
|
|
|
metadataMgr.off('change', checkOnline);
|
|
|
|
|
|
|
|
todo();
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
if (priv.offline) {
|
|
|
|
|
|
|
|
metadataMgr.onChange(checkOnline);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
todo();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
var main = function () {
|
|
|
|
var main = function () {
|
|
|
|