dragend.js 680 B

123456789101112131415161718192021222324252627282930313233
  1. $(function () {
  2. 'use strict';
  3. var $image = $(window.createCropperImage());
  4. $image.on('dragend.cropper', function (e) {
  5. QUnit.test('methods.dragend', function (assert) {
  6. assert.equal(e.type, 'dragend');
  7. assert.equal(e.namespace, 'cropper');
  8. });
  9. }).cropper({
  10. built: function () {
  11. var $dragBox = $image.data('cropper').$dragBox;
  12. // Triggers events manually when built
  13. $dragBox.trigger('mousedown').trigger('mouseup');
  14. },
  15. dragend: function (e) {
  16. QUnit.test('options.dragend', function (assert) {
  17. assert.equal(e.type, 'dragend');
  18. assert.equal(e.namespace, 'cropper');
  19. });
  20. }
  21. });
  22. });