File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ <h2>{{ fieldset.name }}</h2>
5151 {% endif %}
5252 < input type ="submit " value ="Post Only " name ="post_only " />
5353{% endif %}
54+ < div id ="cancel-dialog " style ="display: none; " title ="Cancel {% if form.edit %}editing liaison{% else %}adding new liaison{% endif %} ">
55+ Are you sure you want to return to liaison statement list?< br /> < br /> All data entered into this form will be lost.
56+ </ div >
57+ < input id ="id_cancel " type ="button " value ="Cancel " name ="cancel " />
5458 </ div >
5559</ div >
5660
Original file line number Diff line number Diff line change 137137 var deadline = form . find ( '#id_deadline_date' ) ;
138138 var other_organization = form . find ( '#id_other_organization' ) ;
139139 var approval = form . find ( '#id_approved' ) ;
140+ var cancel = form . find ( '#id_cancel' ) ;
141+ var cancel_dialog = form . find ( '#cancel-dialog' ) ;
140142 var config = { } ;
141143
142144 var readConfig = function ( ) {
226228 }
227229 } ;
228230
231+ var cancelForm = function ( ) {
232+ cancel_dialog . dialog ( "open" ) ;
233+ } ;
234+
229235 var initTriggers = function ( ) {
230236 organization . change ( updateInfo ) ;
231237 organization . change ( checkOtherSDO ) ;
232238 from . change ( updateInfo ) ;
233239 reply . keyup ( updateFrom ) ;
234240 purpose . change ( updatePurpose ) ;
241+ cancel . click ( cancelForm ) ;
235242 } ;
236243
237244 var updateOnInit = function ( ) {
252259 form . find ( '.addAttachmentWidget' ) . AttachmentWidget ( ) ;
253260 } ;
254261
262+ var initDialogs = function ( ) {
263+ cancel_dialog . dialog ( {
264+ resizable : false ,
265+ height :200 ,
266+ modal : true ,
267+ autoOpen : false ,
268+ buttons : {
269+ Ok : function ( ) {
270+ window . location = '..' ;
271+ $ ( this ) . dialog ( "close" ) ;
272+ } ,
273+ Cancel : function ( ) {
274+ $ ( this ) . dialog ( "close" ) ;
275+ }
276+ }
277+ } ) ;
278+ } ;
279+
255280 var initForm = function ( ) {
256281 readConfig ( ) ;
257282 initTriggers ( ) ;
258283 updateOnInit ( ) ;
259284 initDatePicker ( ) ;
260285 initAttachments ( ) ;
286+ initDialogs ( ) ;
261287 } ;
262288
263289 initForm ( ) ;
You can’t perform that action at this time.
0 commit comments