Commit e5d326ea by Kálmán Viktor

dashboard: loading indicator for store upload

parent 0ae8ac7e
......@@ -15,9 +15,10 @@ $(function() {
});
/* less js way, but at least works, tho redirection is bad */
$("#store-list-container").on("click", '#store-upload-form input[type="submit"]', function() {
$("#store-list-container").on("click", '#store-upload-form button[type="submit"]', function() {
var current_dir = $("#store-upload-form").find('[name="current_dir"]').val();
$.get($("#store-upload-form").data("action") + "?current_dir=" + current_dir, function(result) {
$('#store-upload-form button[type="submit"] i').addClass("icon-spinner icon-spin");
$("#store-upload-form").get(0).setAttribute("action", result['url']);
$("#store-upload-form").submit();
});
......@@ -44,10 +45,10 @@ $(function() {
input.val(log);
}
if(log) {
$('#store-upload-form input[type="submit"]').prop("disabled", false);
$('#store-upload-form button[type="submit"]').prop("disabled", false);
} else {
$('#store-upload-form input[type="submit"]').prop("disabled", true);
$('#store-upload-form button[type="submit"]').prop("disabled", true);
}
});
......
......@@ -81,8 +81,9 @@
<input type="text" class="form-control input-tags"
id="store-upload-filename"/>
<span class="input-group-btn">
<input type="submit" class="btn btn-primary btn-xs" disabled
value="{% trans "Upload" %}"/>
<button type="submit" class="btn btn-primary btn-xs" disabled>
<i class="icon-cloud-upload"></i> {% trans "Upload" %}
</button>
</span>
</div>
<input id="store-upload-file" name="data" type="file" style="display:none" multiple>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment