mirror of
https://github.com/jquery/jquery-ui.git
synced 2026-04-20 03:02:41 -04:00
Slider: Switch handles from <a href="#"> to <span tabindex="0">
Fixes #9890 Closes gh-1207
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<script src="../../ui/slider.js"></script>
|
||||
<link rel="stylesheet" href="../demos.css">
|
||||
<style>
|
||||
#eq span {
|
||||
#eq > span {
|
||||
height:120px; float:left; margin:15px
|
||||
}
|
||||
</style>
|
||||
|
||||
14
ui/slider.js
14
ui/slider.js
@@ -83,7 +83,7 @@ return $.widget( "ui.slider", $.ui.mouse, {
|
||||
var i, handleCount,
|
||||
options = this.options,
|
||||
existingHandles = this.element.find( ".ui-slider-handle" ).addClass( "ui-state-default ui-corner-all" ),
|
||||
handle = "<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>",
|
||||
handle = "<span class='ui-slider-handle ui-state-default ui-corner-all' tabindex='0'></span>",
|
||||
handles = [];
|
||||
|
||||
handleCount = ( options.values && options.values.length ) || 1;
|
||||
@@ -149,11 +149,10 @@ return $.widget( "ui.slider", $.ui.mouse, {
|
||||
},
|
||||
|
||||
_setupEvents: function() {
|
||||
var elements = this.handles.add( this.range ).filter( "a" );
|
||||
this._off( elements );
|
||||
this._on( elements, this._handleEvents );
|
||||
this._hoverable( elements );
|
||||
this._focusable( elements );
|
||||
this._off( this.handles );
|
||||
this._on( this.handles, this._handleEvents );
|
||||
this._hoverable( this.handles );
|
||||
this._focusable( this.handles );
|
||||
},
|
||||
|
||||
_destroy: function() {
|
||||
@@ -673,9 +672,6 @@ return $.widget( "ui.slider", $.ui.mouse, {
|
||||
|
||||
this._slide( event, index, newVal );
|
||||
},
|
||||
click: function( event ) {
|
||||
event.preventDefault();
|
||||
},
|
||||
keyup: function( event ) {
|
||||
var index = $( event.target ).data( "ui-slider-handle-index" );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user