Skip to content

Commit c451609

Browse files
committed
Merge branch 'eugenb1-patch-1'
2 parents c0b857a + 7a267e2 commit c451609

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

js/jquery.mobile.forms.slider.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ $.widget( "mobile.slider", $.mobile.widget, {
315315
this.handle.attr( {
316316
"aria-valuenow": cType === "input" ? newval : control.find( "option" ).eq( newval ).attr( "value" ),
317317
"aria-valuetext": cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText(),
318-
title: newval
318+
title: cType === "input" ? newval : control.find( "option" ).eq( newval ).getEncodedText()
319319
});
320320

321321
// add/remove classes for flip toggle switch

tests/unit/slider/slider_core.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@
2727
same( slider.attr('min'), "10", "slider min is greater than 0" );
2828
same( slider.val( '' ).slider( 'refresh' ).val(), slider.attr('min'), "val is equal to min attr");
2929
});
30+
31+
test( "flip toggle switch title should be current selected value attr", function() {
32+
var slider = $( "#slider-switch" );
33+
34+
same(slider.siblings(".ui-slider").find("a").attr('title'),
35+
$(slider.find("option")[slider[0].selectedIndex]).text(),
36+
"verify that the link title is set to the selected option text");
37+
});
3038
})( jQuery );

0 commit comments

Comments
 (0)