File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change 7
7
background-color : # 222 ;
8
8
}
9
9
10
- .swap-image {
10
+ .crop-actions {
11
11
position : absolute;
12
12
top : 0 ;
13
13
right : 0 ;
14
14
15
15
margin : 10px ;
16
- padding : 3px 5px ;
17
- display : inline-block;
16
+ }
17
+
18
+ .crop-actions a {
19
+ display : block;
20
+ min-width : 120px ;
21
+ padding : 4px 5px ;
22
+ margin-bottom : 2px ;
18
23
19
24
border-radius : 5px ;
20
25
text-decoration : none;
21
26
color : # 000 ;
22
27
background : rgba (255 , 255 , 255 , 0.5 );
28
+ text-align : center;
23
29
}
30
+
Original file line number Diff line number Diff line change 34
34
</ div >
35
35
</ div >
36
36
37
- < a class ="swap-image " href =""> swap image</ a >
37
+ < div class ="crop-actions ">
38
+ < a class ="swap-image " href =""> swap image</ a >
39
+ < a class ="reset-image " href =""> reset image</ a >
40
+ </ div >
38
41
39
42
<!-- jquery -->
40
43
< script src ="https://code.jquery.com/jquery-2.1.3.min.js "> </ script >
73
76
event . preventDefault ( ) ;
74
77
} ) ;
75
78
79
+ $ ( '.reset-image' ) . on ( 'click' , function ( event ) {
80
+ crop . reset ( ) ;
81
+ event . preventDefault ( ) ;
82
+ } ) ;
83
+
76
84
} ) ;
77
85
78
86
</ script >
Original file line number Diff line number Diff line change 36
36
</ div >
37
37
</ div >
38
38
39
- < a class ="swap-image " href =""> swap image</ a >
39
+ < div class ="crop-actions ">
40
+ < a class ="swap-image " href =""> swap image</ a >
41
+ < a class ="reset-image " href =""> reset image</ a >
42
+ </ div >
40
43
41
44
<!-- jquery -->
42
45
< script src ="https://code.jquery.com/jquery-2.1.3.min.js "> </ script >
82
85
event . preventDefault ( ) ;
83
86
} ) ;
84
87
88
+ $ ( '.reset-image' ) . on ( 'click' , function ( event ) {
89
+ crop . reset ( ) ;
90
+ event . preventDefault ( ) ;
91
+ } ) ;
92
+
85
93
crop . on ( 'ready' , function ( ) {
86
94
console . log ( 'ready event fired' ) ;
87
95
} ) ;
You can’t perform that action at this time.
0 commit comments