Skip to content

Commit c53fa44

Browse files
committed
Add reset action to example pages
1 parent 1a43b83 commit c53fa44

File tree

3 files changed

+28
-5
lines changed

3 files changed

+28
-5
lines changed

examples/css/page.css

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@ body {
77
background-color: #222;
88
}
99

10-
.swap-image {
10+
.crop-actions {
1111
position: absolute;
1212
top: 0;
1313
right: 0;
1414

1515
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;
1823

1924
border-radius: 5px;
2025
text-decoration: none;
2126
color: #000;
2227
background: rgba(255, 255, 255, 0.5);
28+
text-align: center;
2329
}
30+

examples/fit-to-area.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@
3434
</div>
3535
</div>
3636

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>
3841

3942
<!-- jquery -->
4043
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
@@ -73,6 +76,11 @@
7376
event.preventDefault();
7477
});
7578

79+
$('.reset-image').on('click', function(event) {
80+
crop.reset();
81+
event.preventDefault();
82+
});
83+
7684
});
7785

7886
</script>

examples/index.html

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@
3636
</div>
3737
</div>
3838

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>
4043

4144
<!-- jquery -->
4245
<script src="https://code.jquery.com/jquery-2.1.3.min.js"></script>
@@ -82,6 +85,11 @@
8285
event.preventDefault();
8386
});
8487

88+
$('.reset-image').on('click', function(event) {
89+
crop.reset();
90+
event.preventDefault();
91+
});
92+
8593
crop.on('ready', function() {
8694
console.log('ready event fired');
8795
});

0 commit comments

Comments
 (0)