]> CyberLeo.Net >> Repos - Github/sugarcrm.git/blob - jssource/src_files/include/javascript/yui3/build/scrollview/scrollview-base-ie.js
Release 6.5.0
[Github/sugarcrm.git] / jssource / src_files / include / javascript / yui3 / build / scrollview / scrollview-base-ie.js
1 /*
2 Copyright (c) 2010, Yahoo! Inc. All rights reserved.
3 Code licensed under the BSD License:
4 http://developer.yahoo.com/yui/license.html
5 version: 3.3.0
6 build: 3167
7 */
8 YUI.add('scrollview-base-ie', function(Y) {
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.3.0' ,{requires:['scrollview-base']});