Skip to content

Commit 10827f8

Browse files
committed
Added 2 more options 'data-safe-move' and 'data-fill-color'
- merge pull request andyshora#30 Upgrade to angular 1.5.11
1 parent 432462b commit 10827f8

File tree

4 files changed

+10
-3
lines changed

4 files changed

+10
-3
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ I'm attempting to make a self-contained AngularJS Directive which will allow you
2828
* max-size (integer) - max size of the image, in pixels
2929
* shape (string) - the cropping guideline shape (circle/square)
3030
* step (bound integer) - the variable which dictates which step the user will see (used for resetting purposes)
31+
* safe-move(string true/false) - allow moving the image under the cropping area without restrictions
32+
* fill-color(string color name / HEX) - the color to fill with the empty space (used with safe-move)
3133
* src (bound Blob or base64 string) - scope variable that will be the source image for the crop
3234
* result (bound string) - the variable which will have the resulting data uri bound to it
3335
* result-blob (bound Blob) - the variable which will have the resulting data as a Blob object
@@ -40,6 +42,8 @@ I'm attempting to make a self-contained AngularJS Directive which will allow you
4042
data-width="150"
4143
data-shape="square"
4244
data-step="imageCropStep"
45+
data-safe-move='true'
46+
data-fill-color="red"
4347
src="imgSrc"
4448
data-result="result"
4549
data-result-blob="resultBlob"

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
1111
<!-- REQUIRED 1/3 - AngularJS Core -->
12-
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.11/angular.min.js"></script>
12+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.11/angular.min.js"></script>
1313
<!-- REQUIRED 2/3 - styles for the image crop component -->
1414
<link rel="stylesheet" href="image-crop-styles.css">
1515

index2.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<title>Test</title>
77
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1">
88
<!-- REQUIRED 1/3 - AngularJS Core -->
9-
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.0-beta.11/angular.min.js"></script>
9+
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.11/angular.min.js"></script>
1010
<!-- REQUIRED 2/3 - styles for the image crop component -->
1111
<link rel="stylesheet" href="image-crop-styles.css">
1212
<script>
@@ -116,4 +116,4 @@ <h2>Result</h2>
116116
<p ng-hide="imageCropResult2">Not cropped yet</p>
117117
</div>
118118
</body>
119-
</html>
119+
</html>

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
"cropper",
1818
"avatar"
1919
],
20+
"dependencies": {
21+
"angular": "^1.5.11"
22+
},
2023
"readmeFilename": "README.md",
2124
"bugs": {
2225
"url": "https://github.com/andyshora/angular-image-crop/issues",

0 commit comments

Comments
 (0)