Fix print.

This commit is contained in:
Paulo Gustavo Veiga
2012-05-19 00:13:06 -03:00
parent 4546aaad98
commit 6a6efd58f4
2 changed files with 56 additions and 103 deletions

View File

@@ -71,12 +71,12 @@ jQuery.fn.dialogForm = function(options) {
var containerId = this[0].id;
var url = options.url;
var acceptButtonLabel = options.acceptButtonLabel;
// Clean previous dialog content ...
$("#" + containerId + " div[id='errorMessage']").text("").removeClass("ui-state-highlight");
$('#' + containerId + ' .btn-accept').click(function() {
var acceptBtn = $('#' + containerId + ' .btn-accept');
acceptBtn.click(function() {
var formData = {};
$('#' + containerId + ' input').each(function(index, elem) {
formData[elem.name] = elem.value;
@@ -93,12 +93,14 @@ jQuery.fn.dialogForm = function(options) {
var resourceId = jqXHR.getResponseHeader("ResourceId");
var redirectUrl = options.redirect;
redirectUrl = redirectUrl.replace("{header.resourceId}", resourceId);
$(acceptBtn).button('loading');
$("#" + containerId).modal('hide');
window.location = redirectUrl;
} else if (options.postUpdate) {
options.postUpdate(formData);
}
$(this).dialog("close");
},
error: function(jqXHR, textStatus, errorThrown) {
if (jqXHR.status == 400) {