@@ -310,7 +310,8 @@ module.exports = baseVw.extend({
310310 var self = this ,
311311 targetForm = this . $el . find ( '#transactionConfirmForm' ) ,
312312 confirmData = { } ,
313- confirmStatus ;
313+ confirmStatus ,
314+ targBtn = $ ( e . target ) ;
314315
315316 confirmData . id = this . orderID ;
316317 confirmStatus = app . statusBar . pushMessage ( {
@@ -319,37 +320,47 @@ module.exports = baseVw.extend({
319320 duration : false
320321 } ) ;
321322
322- saveToAPI ( targetForm , '' , this . serverUrl + "confirm_order" , function ( data ) {
323- confirmStatus . updateMessage ( {
324- type : 'confirmed' ,
325- msg : '<i>' + window . polyglot . t ( 'transactions.UpdateComplete' ) + '</i>'
326- } ) ;
327- setTimeout ( function ( ) {
328- confirmStatus && confirmStatus . remove ( ) ;
329- } , 3000 ) ;
330- } , function ( data ) {
331- //onFail
332- confirmStatus . updateMessage ( {
333- type : 'warning' ,
334- msg : '<i>' + window . polyglot . t ( 'transactions.UpdateFailed' ) + '</i>' ,
335- duration : 3000
336- } ) ;
337- setTimeout ( function ( ) {
338- confirmStatus && confirmStatus . remove ( ) ;
339- } , 3000 ) ;
340- } , confirmData , '' , function ( ) {
341- //onInvalid
342- confirmStatus . updateMessage ( {
343- type : 'warning' ,
344- msg : '<i>' + window . polyglot . t ( 'transactions.UpdateInvalid' ) + '</i>' ,
345- duration : 3000
346- } ) ;
347- setTimeout ( function ( ) {
348- confirmStatus && confirmStatus . remove ( ) ;
349- } , 3000 ) ;
350- } , e ) ;
351-
352- this . closeModal ( ) ;
323+ targBtn . addClass ( "loading" ) ;
324+
325+ saveToAPI ( targetForm , '' , this . serverUrl + "confirm_order" ,
326+ function ( data ) {
327+ self . closeModal ( ) ;
328+ confirmStatus . updateMessage ( {
329+ type : 'confirmed' ,
330+ msg : '<i>' + window . polyglot . t ( 'transactions.UpdateComplete' ) + '</i>'
331+ } ) ;
332+ setTimeout ( function ( ) {
333+ confirmStatus && confirmStatus . remove ( ) ;
334+ } , 3000 ) ;
335+ } ,
336+ /*(function(data){
337+ //onFail
338+ confirmStatus.updateMessage({
339+ type: 'warning',
340+ msg: '<i>' + window.polyglot.t('transactions.UpdateFailed') + '</i>',
341+ duration: 3000
342+ });
343+ setTimeout(function(){
344+ confirmStatus && confirmStatus.remove();
345+ },3000);
346+ }*/ '' ,
347+ confirmData , '' ,
348+ /*function(){
349+ //onInvalid
350+ confirmStatus.updateMessage({
351+ type: 'warning',
352+ msg: '<i>' + window.polyglot.t('transactions.UpdateInvalid') + '</i>',
353+ duration: 3000
354+ });
355+ setTimeout(function(){
356+ confirmStatus && confirmStatus.remove();
357+ },3000);
358+ }*/ '' )
359+ . always ( function ( ) {
360+ targBtn . removeClass ( "loading" ) ;
361+ } ) ;
362+
363+ // this.closeModal();
353364 } ,
354365
355366 completeOrder : function ( e ) {
0 commit comments