@@ -24,41 +24,41 @@ define([
24
24
} ,
25
25
26
26
_initContent : function ( ) {
27
- var self = this ;
27
+ var self = this ,
28
+ events = { } ;
28
29
29
30
this . element . decorate ( 'list' , this . options . isRecursive ) ;
30
31
31
- $ ( this . options . button . close ) . click ( function ( event ) {
32
+ events [ 'click ' + this . options . button . close ] = function ( event ) {
32
33
event . stopPropagation ( ) ;
33
34
$ ( self . options . targetElement ) . dropdownDialog ( "close" ) ;
34
- } ) ;
35
-
36
- $ ( this . options . button . checkout ) . on ( 'click' , $ . proxy ( function ( ) {
35
+ } ;
36
+ events [ 'click ' + this . options . button . checkout ] = $ . proxy ( function ( ) {
37
37
var cart = customerData . get ( 'cart' ) ,
38
38
customer = customerData . get ( 'customer' ) ;
39
39
40
40
if ( customer ( ) == false && ! cart ( ) . isGuestCheckoutAllowed ) {
41
41
authenticationPopup . showModal ( ) ;
42
+
42
43
return false ;
43
44
}
44
45
location . href = this . options . url . checkout ;
45
- } , this ) ) ;
46
-
47
- $ ( this . options . button . remove ) . click ( function ( event ) {
46
+ } , this ) ;
47
+ events [ 'click ' + this . options . button . remove ] = function ( event ) {
48
48
event . stopPropagation ( ) ;
49
49
if ( confirm ( self . options . confirmMessage ) ) {
50
- self . _removeItem ( $ ( this ) ) ;
50
+ self . _removeItem ( $ ( event . target ) ) ;
51
51
}
52
- } ) ;
53
-
54
- $ ( this . options . item . qty ) . keyup ( function ( ) {
55
- self . _showItemButton ( $ ( this ) ) ;
56
- } ) ;
57
- $ ( this . options . item . button ) . click ( function ( event ) {
52
+ } ;
53
+ events [ 'keyup ' + this . options . item . qty ] = function ( event ) {
54
+ self . _showItemButton ( $ ( event . target ) ) ;
55
+ } ;
56
+ events [ 'click ' + this . options . item . button ] = function ( event ) {
58
57
event . stopPropagation ( ) ;
59
- self . _updateItemQty ( $ ( this ) )
60
- } ) ;
58
+ self . _updateItemQty ( $ ( event . target ) ) ;
59
+ } ;
61
60
61
+ this . _on ( this . element , events ) ;
62
62
this . _calcHeight ( ) ;
63
63
this . _isOverflowed ( ) ;
64
64
} ,
@@ -122,10 +122,8 @@ define([
122
122
* Update content after update qty
123
123
*
124
124
* @param elem
125
- * @param response
126
- * @private
127
125
*/
128
- _updateItemQtyAfter : function ( elem , response ) {
126
+ _updateItemQtyAfter : function ( elem ) {
129
127
this . _hideItemButton ( elem ) ;
130
128
} ,
131
129
0 commit comments