@behance/helicropter
Advanced tools
Comparing version 15.6.1 to 15.6.2
{ | ||
"name": "@behance/helicropter", | ||
"version": "15.6.1", | ||
"version": "15.6.2", | ||
"description": "My helicropter goes \"whosh whosh whosh\"", | ||
@@ -5,0 +5,0 @@ "main": "src/js/index.js", |
@@ -315,8 +315,10 @@ import extend from '@behance/nbd/util/extend'; | ||
_enableImageManipulation() { | ||
this._uploadArea.hide(); | ||
if (!this._model.get('previewMode')) { | ||
this._uploadArea.hide(); | ||
this._zoomSlider.enable(); | ||
} | ||
this._croppingArea.show(); | ||
this._zoomSlider.enable(); | ||
this.trigger('controls:enabled'); | ||
@@ -369,11 +371,2 @@ }, | ||
_defaults: { | ||
uploaderOptions: { | ||
request: { | ||
endpoint: '', | ||
accessKey: '', | ||
}, | ||
signature: { | ||
endpoint: '', | ||
}, | ||
}, | ||
canvasSize: { | ||
@@ -380,0 +373,0 @@ width: 432, |
@@ -48,2 +48,6 @@ import Spinner from 'spin.js'; | ||
if (!this._model.uploaderOptions) { | ||
return; | ||
} | ||
const config = Object.assign({ | ||
@@ -50,0 +54,0 @@ drift: 0, |
@@ -329,2 +329,22 @@ import $ from 'jquery'; | ||
describe('when it is in preview mode', function() { | ||
it('should just show croppingArea', function(done) { | ||
this.helicropter = this._createWithInitialImage({ | ||
previewMode: true, | ||
}); | ||
spyOn(this.helicropter._view._uploadArea, 'show'); | ||
spyOn(this.helicropter._view._zoomSlider, 'enable'); | ||
this.helicropter.on('image:loaded', function() { | ||
expect(this.helicropter._view._uploadArea.show).not.toHaveBeenCalled(); | ||
expect(this.helicropter._view._zoomSlider.enable).not.toHaveBeenCalled(); | ||
expect(this.helicropter._view._croppingArea.$view).not.toHaveClass('hide'); | ||
done(); | ||
}.bind(this)); | ||
this.helicropter._view._croppingArea.trigger('image-loaded'); | ||
}); | ||
}); | ||
describe('when given preview crop configuration', function() { | ||
@@ -331,0 +351,0 @@ beforeEach(function() { |
@@ -43,2 +43,10 @@ import $ from 'jquery'; | ||
it('should not instantiate without proper uploaderOptions', function() { | ||
this.uploadArea = this.create({ | ||
uploaderOptions: null, | ||
}); | ||
expect(this.uploadArea._uploader).toBe(undefined); | ||
}); | ||
it('supplies a default title', function() { | ||
@@ -45,0 +53,0 @@ expect(this.options.titleText).not.toBeDefined(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8698313
4948