Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit a53090e

Browse files
Button: Set button text as title attribute value for icon-only buttons.
1 parent fa8403d commit a53090e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

js/widgets/forms/button.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,17 @@ $.widget( "mobile.button", $.mobile.widget, {
126126
if ( !o.iconpos ) {
127127
o.iconpos = "left";
128128
}
129+
129130
classes += " ui-icon-" + o.icon + " ui-btn-icon-" + o.iconpos;
131+
132+
if ( o.iconpos === "notext" && !$el.attr( "title" ) ) {
133+
if ( $el[ 0 ].tagName === "INPUT" ) {
134+
$el.attr( "title", $el.val() );
135+
} else {
136+
$el.attr( "title", $el.getEncodedText() );
137+
}
138+
}
139+
130140
if ( o.iconshadow ) {
131141
classes += " ui-shadow-icon";
132142
}

0 commit comments

Comments
 (0)