Cancel button added in liasion form. Fixes

- Legacy-Id: 2535
This commit is contained in:
Emilio A. Sánchez López 2010-09-27 08:06:02 +00:00
parent b94e5eb7f3
commit dad6332923
2 changed files with 30 additions and 0 deletions
ietf/templates/liaisons
static/js

View file

@ -51,6 +51,10 @@
{% endif %}
<input type="submit" value="Post Only" name="post_only" />
{% endif %}
<div id="cancel-dialog" style="display: none;" title="Cancel {% if form.edit %}editing liaison{% else %}adding new liaison{% endif %}">
Are you sure you want to return to liaison statement list?<br/><br/>All data entered into this form will be lost.
</div>
<input id="id_cancel" type="button" value="Cancel" name="cancel" />
</div>
</div>

View file

@ -137,6 +137,8 @@
var deadline = form.find('#id_deadline_date');
var other_organization = form.find('#id_other_organization');
var approval = form.find('#id_approved');
var cancel = form.find('#id_cancel');
var cancel_dialog = form.find('#cancel-dialog');
var config = {};
var readConfig = function() {
@ -226,12 +228,17 @@
}
};
var cancelForm = function() {
cancel_dialog.dialog("open");
};
var initTriggers = function() {
organization.change(updateInfo);
organization.change(checkOtherSDO);
from.change(updateInfo);
reply.keyup(updateFrom);
purpose.change(updatePurpose);
cancel.click(cancelForm);
};
var updateOnInit = function() {
@ -252,12 +259,31 @@
form.find('.addAttachmentWidget').AttachmentWidget();
};
var initDialogs = function() {
cancel_dialog.dialog({
resizable: false,
height:200,
modal: true,
autoOpen: false,
buttons: {
Ok: function() {
window.location='..';
$( this ).dialog( "close" );
},
Cancel: function() {
$( this ).dialog( "close" );
}
}
});
};
var initForm = function() {
readConfig();
initTriggers();
updateOnInit();
initDatePicker();
initAttachments();
initDialogs();
};
initForm();