movable.js 655 B

1234567891011121314151617181920212223242526272829303132
  1. $(function () {
  2. 'use strict';
  3. var $image = $(window.createCropperImage());
  4. $image.cropper({
  5. movable: false,
  6. built: function () {
  7. var cropper = $image.data('cropper'),
  8. cropBox = cropper.cropBox,
  9. _left = cropBox.left,
  10. _top = cropBox.top;
  11. QUnit.test('methods.move', function (assert) {
  12. $image.cropper('move', 10, 10);
  13. assert.equal(cropBox.left, _left);
  14. assert.equal(cropBox.top, _top);
  15. });
  16. QUnit.test('options.movable', function (assert) {
  17. assert.notEqual(cropper.$cropper.find('.cropper-face').data('directive'), 'all');
  18. });
  19. }
  20. });
  21. });