minCanvasWidth.js 483 B

1234567891011121314151617181920212223242526
  1. $(function () {
  2. 'use strict';
  3. var $image = $(window.createCropperImage()),
  4. minCanvasWidth = 160;
  5. $image.cropper({
  6. strict: false,
  7. minCanvasWidth: minCanvasWidth,
  8. built: function () {
  9. QUnit.test('options.minCanvasWidth', function (assert) {
  10. var data = $image.cropper('setCanvasData', {
  11. width: 80
  12. }).cropper('getCanvasData');
  13. assert.ok(Math.round(data.width) === minCanvasWidth);
  14. });
  15. }
  16. });
  17. });