Skip to content

Commit

Permalink
implement loader
Browse files Browse the repository at this point in the history
  • Loading branch information
vangheem committed May 14, 2015
1 parent 6ab04e2 commit 9f72bcc
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions plone/app/portlets/browser/manage-portlets.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ define([
window.location.reload();
}
});

that.loading = modal.loading;
}else{
that.loading = utils.loading;
}
that.bind();
},
Expand All @@ -44,6 +46,7 @@ define([
/* if we're in a modal, it's possible we have a link to
parent case, bind the link so we can reload modal */
$('.portlets-link-to-parent').off('click').click(function(e){
that.loading.show();
var $el = $(this);
e.preventDefault();
$.ajax({
Expand All @@ -61,6 +64,7 @@ define([
$h1.remove();
$modal.append($content);
that.rebind($('.pat-manage-portlets', $content), true);
that.loading.hide();
});
});
}
Expand Down Expand Up @@ -159,10 +163,16 @@ define([
},
setupSavePortletsSettings: function(){
var that = this;
$('.portlets-settings,form.portlet-action', that.$el).ajaxForm(function(html){
log.info('form submit');
var $body = $(utils.parseBodyTag(html));
that.rebind($('#' + that.$el.attr('id'), $body).eq(0));
$('.portlets-settings,form.portlet-action', that.$el).ajaxForm({
beforeSubmit: function(){
that.loading.show();
},
success: function(html){
that.loading.hide();
log.info('form submit');
var $body = $(utils.parseBodyTag(html));
that.rebind($('#' + that.$el.attr('id'), $body).eq(0));
}
});
$('.portlets-settings select', that.$el).change(function(){
log.info('select change');
Expand Down

0 comments on commit 9f72bcc

Please sign in to comment.