Skip to content
This repository has been archived by the owner on Nov 27, 2018. It is now read-only.

Commit

Permalink
fix(api): Add test before removing controls
Browse files Browse the repository at this point in the history
Closes #30
  • Loading branch information
bcabanes committed Mar 15, 2016
1 parent f5f6fb4 commit fad7442
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions dev/app/app.js
Expand Up @@ -14,7 +14,7 @@ angular

// Some cropper options.
vm.imageUrl = 'assets/images/unsplash_' + getRandomInt(1, 1) + '.jpg';
vm.showControls = true;
vm.showControls = false;
vm.fit = false;

vm.myButtonLabels = {
Expand All @@ -32,12 +32,13 @@ angular
};

// Cropper API available when image is ready.
//vm.cropperApi = functigit staon(cropperApi) {
//cropperApi.zoomOut(10);
//cropperApi.zoomIn(20);
//cropperApi.rotate(270);
//cropperApi.fit();
//vm.cropperApi = function(cropperApi) {
// cropperApi.zoomOut(10);
// cropperApi.zoomIn(20);
// cropperApi.rotate(270);
// cropperApi.fit();
// vm.resultImage = cropperApi.crop();
// //cropperApi.remove();
// $scope.$apply(); // Apply the changes.
//};

Expand Down
2 changes: 1 addition & 1 deletion src/imageCropper.js
Expand Up @@ -219,7 +219,7 @@ Cropper.prototype.buildDOM = function() {
Cropper.prototype.remove = function() {
var elements = this.elements;
elements.target.removeChild(elements.wrapper);
elements.target.removeChild(elements.controls.wrapper);
if (this.options.showControls) elements.target.removeChild(elements.controls.wrapper);
};

Cropper.prototype.loadImage = function() {
Expand Down

0 comments on commit fad7442

Please sign in to comment.