2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
8 YUI.add('scrollview-base-ie', function(Y) {
11 * IE specific support for the scrollview-base module.
13 * @module scrollview-base-ie
16 Y.mix(Y.ScrollView.prototype, {
19 * Internal method to fix text selection in IE
21 * @method _fixIESelect
24 * @param {Node} bb The bounding box
25 * @param {Node} cb The content box
27 _fixIESelect : function(bb, cb) {
28 this._cbDoc = cb.get("ownerDocument");
29 this._nativeBody = Y.Node.getDOMNode(Y.one("body", this._cbDoc));
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);
39 * Native onselectstart handle to prevent selection in IE
41 * @method _iePreventSelect
45 _iePreventSelect : function() {
50 * Restores native onselectstart handle, backed up to prevent selection in IE
52 * @method _ieRestoreSelect
56 _ieRestoreSelect : function() {
57 this._nativeBody.onselectstart = this._selectstart;
62 }, '3.3.0' ,{requires:['scrollview-base']});