[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/lib/yuilib/3.17.2/scrollview-base-ie/ -> scrollview-base-ie-debug.js (source)

   1  /*
   2  YUI 3.17.2 (build 9c3c78e)
   3  Copyright 2014 Yahoo! Inc. All rights reserved.
   4  Licensed under the BSD License.
   5  http://yuilibrary.com/license/
   6  */
   7  
   8  YUI.add('scrollview-base-ie', function (Y, NAME) {
   9  
  10  /**
  11   * IE specific support for the scrollview-base module.
  12   *
  13   * @module scrollview-base-ie
  14   */
  15  
  16  Y.mix(Y.ScrollView.prototype, {
  17  
  18      /**
  19       * Internal method to fix text selection in IE
  20       *
  21       * @method _fixIESelect
  22       * @for ScrollView
  23       * @private
  24       * @param {Node} bb The bounding box
  25       * @param {Node} cb The content box
  26       */
  27      _fixIESelect : function(bb, cb) {
  28          this._cbDoc = cb.get("ownerDocument");
  29          this._nativeBody = Y.Node.getDOMNode(Y.one("body", this._cbDoc));
  30  
  31          cb.on("mousedown", function() {
  32              this._selectstart = this._nativeBody.onselectstart;
  33              this._nativeBody.onselectstart = this._iePreventSelect;
  34              this._cbDoc.once("mouseup", this._ieRestoreSelect, this);
  35          }, this);
  36      },
  37  
  38      /**
  39       * Native onselectstart handle to prevent selection in IE
  40       *
  41       * @method _iePreventSelect
  42       * @for ScrollView
  43       * @private
  44       */
  45      _iePreventSelect : function() {
  46          return false;
  47      },
  48  
  49      /**
  50       * Restores native onselectstart handle, backed up to prevent selection in IE
  51       *
  52       * @method _ieRestoreSelect
  53       * @for ScrollView
  54       * @private
  55       */
  56      _ieRestoreSelect : function() {
  57          this._nativeBody.onselectstart = this._selectstart;
  58      }
  59  }, true);
  60  
  61  
  62  }, '3.17.2', {"requires": ["scrollview-base"]});


Generated: Thu Aug 11 10:00:09 2016 Cross-referenced by PHPXref 0.7.1