From 28310ff55f062199fb2f187ea13d3561a879aea8 Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Thu, 12 Dec 2013 22:10:06 -0500 Subject: Slider & Interactions: Add Windows 8 touch support Fixes #9709 Fixes #9710 Closes gh-1152 --- ui/jquery.ui.draggable.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'ui/jquery.ui.draggable.js') diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index f18b383d3..5cbe92fce 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -60,9 +60,16 @@ $.widget("ui.draggable", $.ui.mouse, { if (this.options.disabled){ this.element.addClass("ui-draggable-disabled"); } + this._setHandleClassName(); this._mouseInit(); + }, + _setOption: function( key, value ) { + this._super( key, value ); + if ( key === "handle" ) { + this._setHandleClassName(); + } }, _destroy: function() { @@ -71,6 +78,7 @@ $.widget("ui.draggable", $.ui.mouse, { return; } this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" ); + this._removeHandleClassName(); this._mouseDestroy(); }, @@ -296,6 +304,17 @@ $.widget("ui.draggable", $.ui.mouse, { true; }, + _setHandleClassName: function() { + this._removeHandleClassName(); + $( this.options.handle || this.element ).addClass( "ui-draggable-handle" ); + }, + + _removeHandleClassName: function() { + this.element.find( ".ui-draggable-handle" ) + .addBack() + .removeClass( "ui-draggable-handle" ); + }, + _createHelper: function(event) { var o = this.options, -- cgit v1.2.3