rotate.js 610 B

123456789101112131415161718192021222324252627
  1. $(function () {
  2. 'use strict';
  3. var $image = $(window.createCropperImage());
  4. $image.cropper({
  5. built: function () {
  6. var image = $image.data('cropper').image;
  7. QUnit.test('methods.rotate', function (assert) {
  8. assert.ok(image.rotate === 0);
  9. $image.cropper('rotate', 360);
  10. assert.ok(image.rotate === 0);
  11. $image.cropper('rotate', 30);
  12. assert.ok(image.rotate === 30);
  13. $image.cropper('rotate', -15);
  14. assert.ok(image.rotate === 15);
  15. $image.cropper('rotate', -15);
  16. assert.ok(image.rotate === 0);
  17. });
  18. }
  19. });
  20. });