File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,8 @@ $(document).ready(function() {
111111
112112 $ . fn . calculateChange = function ( ) {
113113 var change =
114- $ ( this ) . priceToInt ( $ ( "#payment" ) . val ( ) ) -
115- $ ( this ) . priceToInt ( $ ( "#payablePrice" ) . val ( ) )
114+ $ ( this ) . priceToInt ( $ ( "#payment" ) . val ( ) ) -
115+ $ ( this ) . priceToInt ( $ ( "#payablePrice" ) . val ( ) ) ;
116116 if ( change > 0 ) {
117117 $ ( "#change" ) . text ( $ ( this ) . formatPrice ( change ) ) ;
118118 } else {
@@ -124,4 +124,17 @@ $(document).ready(function() {
124124 $ ( "#confirmPayment" ) . hide ( ) ;
125125 }
126126 } ;
127+
128+ $ . fn . delDigits = function ( ) {
129+ $ ( "#payment" ) . val (
130+ $ ( this ) . formatPrice (
131+ $ ( this ) . priceToInt (
132+ $ ( "#payment" )
133+ . val ( )
134+ . substr ( 0 , $ ( "#payment" ) . val ( ) . length - 1 ) ,
135+ ) ,
136+ ) ,
137+ ) ;
138+ $ ( this ) . calculateChange ( ) ;
139+ } ;
127140} ) ;
Original file line number Diff line number Diff line change @@ -456,7 +456,7 @@ <h4 class="modal-title" id="myLargeModalLabel">Trả tiền</h4>
456456 < br >
457457 < div class ="row ">
458458 < div class ="col-md-3 ">
459- < button onclick ="$('#payment').val($('#payment').val().substr(0,$('#payment').val().length -1));$( this).calculateChange (); " class ="btn btn-success btn-lg btn-block "> ⌫</ button >
459+ < button onclick ="$(this).delDigits (); " class ="btn btn-success btn-lg btn-block "> ⌫</ button >
460460 </ div >
461461 < div class ="col-md-3 ">
462462 < button onclick ="$(this).go(0,false); " class ="btn btn-success btn-lg btn-block "> 0</ button >
You can’t perform that action at this time.
0 commit comments