Skip to content

Commit f7ad804

Browse files
committed
Release v1.0.1
1 parent 0c6991d commit f7ad804

File tree

5 files changed

+18
-7
lines changed

5 files changed

+18
-7
lines changed

Changelog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# v1.0.1
2+
3+
- Avoid infinite loop when setting ratio [#5](https://github.com/upfrontIO/srcissors/pull/5)
4+
15

26
# v1.0.0
37

@@ -17,4 +21,3 @@
1721
# v0.1.0
1822

1923
Initial Release
20-

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "srcissors",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"homepage": "https://github.com/upfrontIO/srcissors",
55
"description": "Image cropping for responsive images",
66
"author": "upfront.io",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "srcissors",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"homepage": "https://github.com/upfrontIO/srcissors",
55
"description": "Image cropping for responsive images",
66
"author": "upfront.io",

srcissors.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,11 @@ module.exports = Crop = (function() {
1414
this.loadingCssClass = 'crop-view--is-loading';
1515
this.panningCssClass = 'crop-view--is-panning';
1616
this.outlineCssClass = 'crop-outline--active';
17-
this.isReady = false;
1817
this.isPanning = false;
1918
this.initialCrop = crop;
20-
this.readyEvent = $.Callbacks('memory once');
2119
this.loadEvent = $.Callbacks();
2220
this.changeEvent = $.Callbacks();
21+
this.initializeReadyState();
2322
this.zoomInStep = zoomStep;
2423
this.zoomOutStep = 1 / this.zoomInStep;
2524
this.arenaWidth = this.arena.width();
@@ -35,14 +34,23 @@ module.exports = Crop = (function() {
3534
this.setImage(url);
3635
}
3736

37+
Crop.prototype.initializeReadyState = function() {
38+
var _ref;
39+
this.isReady = false;
40+
if ((_ref = this.readyEvent) != null) {
41+
_ref.empty();
42+
}
43+
return this.readyEvent = $.Callbacks('memory once');
44+
};
45+
3846
Crop.prototype.setImage = function(url) {
3947
if (url === this.preview.url) {
4048
return;
4149
}
4250
if (this.isInitialized) {
4351
this.preview.reset();
4452
}
45-
this.isReady = false;
53+
this.initializeReadyState();
4654
this.view.addClass(this.loadingCssClass);
4755
return this.preview.setImage({
4856
url: url

srcissors.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)