NIHVIVO 3789 applying same changes to the addAuthorsToPub template and js

This commit is contained in:
tworrall 2012-06-15 17:29:00 +00:00
parent 426866b837
commit a103fdc486
4 changed files with 50 additions and 12 deletions

View file

@ -100,7 +100,8 @@
<input type="submit" id="showAddFormButton" value="Add Author" role="button" />
<span class="or"> or </span>
<a class="cancel" href="${cancelUrl}&url=/individual" title="Cancel">Return to Publication</a>
<a id="returnLink" class="cancel" href="${cancelUrl}&url=/individual" title="Cancel">Return to Publication</a>
<img id="indicatorOne" class="indicator hidden" title="one" src="${urls.base}/images/indicatorWhite.gif" />
</section>
<form id="addAuthorForm" action ="${submitUrl}" class="customForm noIE67">
@ -167,7 +168,8 @@
<span class="or"> or </span>
<a class="cancel" href="${cancelUrl}" title="Cancel">Cancel</a>
<a id="returnLink" class="cancel" href="${cancelUrl}" title="Cancel">Cancel</a>
<img id="indicatorTwo" title="two" class="indicator hidden" src="${urls.base}/images/indicatorWhite.gif" />
</p>
<p id="requiredLegend" class="requiredHint">* required fields</p>

View file

@ -72,6 +72,7 @@ var addAuthorForm = {
this.selectedOrgName = $('span#selectedOrgName');
this.orgLink = $('a#orgLink');
this.personLink = $('a#personLink');
this.returnLink = $('a#returnLink');
this.orgSection.hide();
},
@ -618,11 +619,23 @@ var addAuthorForm = {
var removeLast = false,
message = 'Are you sure you want to remove this author:\n\n' + authorName + ' ?\n\n';
if (!confirm(message)) {
return false;
}
if ( addAuthorForm.showFormButtonWrapper.is(':visible') ) {
addAuthorForm.returnLink.hide();
$('img#indicatorOne').removeClass('hidden');
addAuthorForm.showFormButton.addClass('disabledSubmit');
addAuthorForm.showFormButton.attr('disabled','disabled');
}
else {
addAuthorForm.cancel.hide();
$('img#indicatorTwo').removeClass('hidden');
addAuthorForm.submit.addClass('disabledSubmit');
addAuthorForm.submit.attr('disabled','disabled');
}
if ($(link)[0] === $('.remove:last')[0]) {
removeLast = true;
}
@ -671,15 +684,34 @@ var addAuthorForm = {
if (numAuthors < 2) {
addAuthorForm.disableAuthorDD();
}
if ( $('img#indicatorOne').is(':visible') ) {
$('img#indicatorOne').fadeOut(100, function() {
$(this).addClass('hidden');
});
addAuthorForm.returnLink.fadeIn(100, function() {
$(this).show();
});
addAuthorForm.showFormButton.removeClass('disabledSubmit');
addAuthorForm.showFormButton.attr('disabled','');
}
else {
$('img#indicatorTwo').fadeOut(100, function() {
$(this).addClass('hidden');
});
addAuthorForm.cancel.fadeIn(100, function() {
$(this).show();
});
addAuthorForm.submit.removeClass('disabledSubmit');
addAuthorForm.submit.attr('disabled','');
}
});
// $(this).hide();
// $(this).siblings('.undo').show();
// author.html(authorName + ' has been removed');
// author.css('width', 'auto');
// author.effect('highlight', {}, 3000);
} else {
alert('Error processing request: author not removed');
}
}
});

View file

@ -160,6 +160,8 @@ var manageWebpages = {
$('a#returnToIndividual').hide();
$('img#indicator').removeClass('hidden');
$('a#showAddForm').addClass('disabledSubmit');
$('a#showAddForm').attr('disabled', 'disabled');
if ($(link)[0] === $('.remove:last')[0]) {
removeLast = true;
@ -200,15 +202,17 @@ var manageWebpages = {
}
$('img#indicator').fadeOut(100, function() {
$(this).addClass('hidden');
})
});
$('a#returnToIndividual').fadeIn(100, function() {
$(this).show();
});
$('a#showAddForm').removeClass('disabledSubmit');
$('a#showAddForm').attr('disabled', '');
});
} else {
alert('Error processing request: web page not removed');
alert('Error processing request: web page not removed.');
}
}
});

View file

@ -59,7 +59,7 @@
<a href="${showAddFormUrl}" id="showAddForm" class="button green" title="add new web page">Add New Web Page</a>
<a href="${cancelUrl}" id="returnToIndividual" class="return" title="return to individual">Return to Individual</a>
<img id="indicator" class="hidden" src="${urls.base}/images/indicatorWhite.gif" />
<img id="indicator" class="indicator hidden" src="${urls.base}/images/indicatorWhite.gif" />
</section>