diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2015-10-06 15:42:24 +0200 |
---|---|---|
committer | Alexander Schmitz <arschmitz@gmail.com> | 2015-10-08 14:02:59 -0400 |
commit | 2bf307313b9e40900193267bc2fb779b9ab24b5c (patch) | |
tree | 971ccf6446c01347a25b6a4da58ab73d9488a609 /ui/widgets/checkboxradio.js | |
parent | dc2bede25408364a0f2f01d6b53ecc1b5d0b41c3 (diff) | |
download | jquery-ui-2bf307313b9e40900193267bc2fb779b9ab24b5c.tar.gz jquery-ui-2bf307313b9e40900193267bc2fb779b9ab24b5c.zip |
Checkboxradio: Fix invalid chars, remove unused var, add comment
Diffstat (limited to 'ui/widgets/checkboxradio.js')
-rw-r--r-- | ui/widgets/checkboxradio.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/widgets/checkboxradio.js b/ui/widgets/checkboxradio.js index 88b2f784d..6bdd858db 100644 --- a/ui/widgets/checkboxradio.js +++ b/ui/widgets/checkboxradio.js @@ -59,6 +59,7 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { labels = this.element.labels(); + // If there are multiple labels, use the last one this.label = $( labels[ labels.length - 1 ] ); if ( !this.label.length ) { $.error( "No label found for checkboxradio widget" ); @@ -152,11 +153,11 @@ $.widget( "ui.checkboxradio", [ $.ui.formResetMixin, { _getRadioGroup: function() { var name = this.element[ 0 ].name; var formParent = this.formParent[ 0 ]; - var radios = $( [] ); if ( !name ) { return $( [] ); - }`` + } + return this.formParent.find( "[name='" + $.ui.escapeSelector( name ) + "']" ).filter( function() { var form = $( this ).form(); return ( form.length ? form : $( "body" ) )[ 0 ] === formParent; |