You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

constructor.js 738 B

4 years ago
1234567891011121314151617181920212223242526272829
  1. // Jcrop constructor
  2. var Jcrop = function(element,opt){
  3. var _ua = navigator.userAgent.toLowerCase();
  4. this.opt = $.extend({},Jcrop.defaults,opt || {});
  5. this.container = $(element);
  6. this.opt.is_msie = /msie/.test(_ua);
  7. this.opt.is_ie_lt9 = /msie [1-8]\./.test(_ua);
  8. this.container.addClass(this.opt.css_container);
  9. this.ui = {};
  10. this.state = null;
  11. this.ui.multi = [];
  12. this.ui.selection = null;
  13. this.filter = {};
  14. this.init();
  15. this.setOptions(opt);
  16. this.applySizeConstraints();
  17. this.container.trigger('cropinit',this);
  18. // IE<9 doesn't work if mouse events are attached to window
  19. if (this.opt.is_ie_lt9)
  20. this.opt.dragEventTarget = document.body;
  21. };