3 Copyright 2012 Yahoo! Inc. All rights reserved.
4 Licensed under the BSD License.
5 http://yuilibrary.com/license/
7 YUI.add('scrollview-base-ie', function(Y) {
10 * IE specific support for the scrollview-base module.
12 * @module scrollview-base-ie
15 Y.mix(Y.ScrollView.prototype, {
18 * Internal method to fix text selection in IE
20 * @method _fixIESelect
23 * @param {Node} bb The bounding box
24 * @param {Node} cb The content box
26 _fixIESelect : function(bb, cb) {
27 this._cbDoc = cb.get("ownerDocument");
28 this._nativeBody = Y.Node.getDOMNode(Y.one("body", this._cbDoc));
30 cb.on("mousedown", function() {
31 this._selectstart = this._nativeBody.onselectstart;
32 this._nativeBody.onselectstart = this._iePreventSelect;
33 this._cbDoc.once("mouseup", this._ieRestoreSelect, this);
38 * Native onselectstart handle to prevent selection in IE
40 * @method _iePreventSelect
44 _iePreventSelect : function() {
49 * Restores native onselectstart handle, backed up to prevent selection in IE
51 * @method _ieRestoreSelect
55 _ieRestoreSelect : function() {
56 this._nativeBody.onselectstart = this._selectstart;
61 }, '3.5.0' ,{requires:['scrollview-base']});