File tree 1 file changed +8
-3
lines changed
1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ var jconfirm, Jconfirm;
29
29
*/
30
30
$ ( this ) . each ( function ( ) {
31
31
var $this = $ ( this ) ;
32
+ if ( $this . attr ( 'jc-attached' ) ) {
33
+ console . warn ( 'jConfirm has already binded to this element ' , $this [ 0 ] ) ;
34
+ return ;
35
+ }
36
+
32
37
$this . on ( 'click' , function ( e ) {
33
38
e . preventDefault ( ) ;
34
39
var jcOption = $ . extend ( { } , options ) ;
@@ -49,8 +54,10 @@ var jconfirm, Jconfirm;
49
54
} ;
50
55
}
51
56
jcOption [ 'closeIcon' ] = false ;
52
- $ . confirm ( jcOption ) ;
57
+ var instance = $ . confirm ( jcOption ) ;
53
58
} ) ;
59
+
60
+ $this . attr ( 'jc-attached' , true ) ;
54
61
} ) ;
55
62
return $ ( this ) ;
56
63
} ;
@@ -1324,10 +1331,8 @@ var jconfirm, Jconfirm;
1324
1331
$ ( window ) . on ( 'keyup' , function ( ) {
1325
1332
keyDown = false ;
1326
1333
} ) ;
1327
-
1328
1334
jconfirm . lastClicked = false ;
1329
1335
$ ( document ) . on ( 'mousedown' , 'button, a' , function ( ) {
1330
- console . log ( 'hey clicked' , this ) ;
1331
1336
jconfirm . lastClicked = $ ( this ) ;
1332
1337
} ) ;
1333
1338
} ) ( jQuery , window ) ;
You can’t perform that action at this time.
0 commit comments