76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassYUI.add('scrollview-base-ie', function(Y) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass/**
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * IE specific support for the scrollview-base module.
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass *
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @module scrollview-base-ie
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass */
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav GlassY.mix(Y.ScrollView.prototype, {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass /**
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Internal method to fix text selection in IE
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass *
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _fixIESelect
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @for ScrollView
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @private
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Node} bb The bounding box
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @param {Node} cb The content box
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass */
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass _fixIESelect : function(bb, cb) {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this._cbDoc = cb.get("ownerDocument");
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this._nativeBody = Y.Node.getDOMNode(Y.one("body", this._cbDoc));
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass cb.on("mousedown", function() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this._selectstart = this._nativeBody.onselectstart;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this._nativeBody.onselectstart = this._iePreventSelect;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this._cbDoc.once("mouseup", this._ieRestoreSelect, this);
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass }, this);
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass },
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass /**
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Native onselectstart handle to prevent selection in IE
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass *
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _iePreventSelect
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @for ScrollView
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @private
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass */
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass _iePreventSelect : function() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass return false;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass },
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass /**
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * Restores native onselectstart handle, backed up to prevent selection in IE
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass *
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @method _ieRestoreSelect
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @for ScrollView
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass * @private
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass */
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass _ieRestoreSelect : function() {
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass this._nativeBody.onselectstart = this._selectstart;
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass }
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass}, true);
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass
76ca635d61eb3f9fb7c9d788a44fa8b1690aa138Dav Glass}, '@VERSION@' ,{requires:['scrollview-base']});