API Docs for: 3.18.1
Show:

File: scrollview/js/ScrollViewBaseIE.js

  1. /**
  2. * IE specific support for the scrollview-base module.
  3. *
  4. * @module scrollview-base-ie
  5. */
  6.  
  7. Y.mix(Y.ScrollView.prototype, {
  8.  
  9. /**
  10. * Internal method to fix text selection in IE
  11. *
  12. * @method _fixIESelect
  13. * @for ScrollView
  14. * @private
  15. * @param {Node} bb The bounding box
  16. * @param {Node} cb The content box
  17. */
  18. _fixIESelect : function(bb, cb) {
  19. this._cbDoc = cb.get("ownerDocument");
  20. this._nativeBody = Y.Node.getDOMNode(Y.one("body", this._cbDoc));
  21.  
  22. cb.on("mousedown", function() {
  23. this._selectstart = this._nativeBody.onselectstart;
  24. this._nativeBody.onselectstart = this._iePreventSelect;
  25. this._cbDoc.once("mouseup", this._ieRestoreSelect, this);
  26. }, this);
  27. },
  28.  
  29. /**
  30. * Native onselectstart handle to prevent selection in IE
  31. *
  32. * @method _iePreventSelect
  33. * @for ScrollView
  34. * @private
  35. */
  36. _iePreventSelect : function() {
  37. return false;
  38. },
  39.  
  40. /**
  41. * Restores native onselectstart handle, backed up to prevent selection in IE
  42. *
  43. * @method _ieRestoreSelect
  44. * @for ScrollView
  45. * @private
  46. */
  47. _ieRestoreSelect : function() {
  48. this._nativeBody.onselectstart = this._selectstart;
  49. }
  50. }, true);
  51.