Add loader

This commit is contained in:
Nicolas Le Goff
2012-10-19 14:16:34 +02:00
parent ec8d577a41
commit d0ad79c318
2 changed files with 28 additions and 18 deletions

View File

@@ -114,9 +114,12 @@
</tfoot>
</table>
{% endfor %}
<div class="form-actions">
<div class="form-actions" style="background:transparent">
<button type="button" class="btn btn-primary submiter">{% trans "Apply changes" %}</button>
<button type="button" class="btn cancel">{% trans "Cancel" %}</button>
<span class="form-action-loader" style="display:none;">
<img src="../skins/icons/loader414141.gif" />
</span>
</div>
</form>
</div>
@@ -139,6 +142,7 @@
$("button.submiter", $dialogBox).bind("click", function(){
var $this = $(this);
var form = $(this).closest("form");
var loader = form.find("form-action-loader");
$.ajax({
type: form.attr("method"),
@@ -147,13 +151,14 @@
dataType: 'json',
beforeSend:function(){
$this.attr("disabled", true);
//@todo add loader
loader.show();
},
success: function(data){
$dialog.Close();
},
complete: function(){
$this.attr("disabled", false);
loader.hide();
}
});
});