-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Button icon span #1216
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button icon span #1216
Changes from 1 commit
d0d24a1
cf6e119
747635a
b408636
d344b50
d903e1a
6591ad1
b782bfc
19c6b9e
3223c29
01c54ec
fe00326
35564dd
0d71cbf
995a855
f55d4ce
1e225e7
d566fec
1ccec99
8d64f1f
21afafd
661ce0e
d3b0f85
0fead84
9b7dbc6
234aeb1
06455ac
320e2ec
c485bc5
4ab74f1
bad64ec
d95139e
b865d59
baf108e
841abaf
48c7481
dae9466
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Allows easy extension for mobiles enhanced option
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,22 +22,22 @@ var baseClasses = "ui-button ui-widget ui-corner-all", | |
| }, 1 ); | ||
| }, | ||
| radioGroup = function( radio ) { | ||
| var name = radio.name, | ||
| form = radio.form, | ||
| radios = $( [] ); | ||
| if ( name ) { | ||
| name = name.replace( /'/g, "\\'" ); | ||
| if ( form ) { | ||
| radios = $( form ).find( "[name='" + name + "']" ); | ||
| } else { | ||
| radios = $( "[name='" + name + "']", radio.ownerDocument ) | ||
| .filter(function() { | ||
| return !this.form; | ||
| }); | ||
| } | ||
| } | ||
| return radios; | ||
| }; | ||
| var name = radio.name, | ||
| form = radio.form, | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should either use |
||
| radios = $( [] ); | ||
| if ( name ) { | ||
| name = name.replace( /'/g, "\\'" ); | ||
| if ( form ) { | ||
| radios = $( form ).find( "[name='" + name + "']" ); | ||
| } else { | ||
| radios = $( "[name='" + name + "']", radio.ownerDocument ) | ||
| .filter(function() { | ||
| return !this.form; | ||
| }); | ||
| } | ||
| } | ||
| return radios; | ||
| }; | ||
|
|
||
| $.widget( "ui.checkboxradio", { | ||
| version: "@VERSION", | ||
|
|
@@ -78,6 +78,16 @@ $.widget( "ui.checkboxradio", { | |
|
|
||
| this._getLabel(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's reorder the method definitions based on how they're used here. |
||
|
|
||
| this._enhance(); | ||
|
|
||
| this._on({ | ||
| "change" : "_toggleClasses", | ||
| "focus": "_handleFocus", | ||
| "blur": "_handleBlur" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This two are so trivial, might as well define the functions here directly. The method names aren't great anyway. |
||
| }); | ||
| }, | ||
|
|
||
| enhance: function() { | ||
| this.element.addClass( "ui-helper-hidden-accessible ui-checkboxradio" ); | ||
|
|
||
| this.label.addClass( baseClasses + " ui-" + this.type + "-label" ); | ||
|
|
@@ -98,12 +108,6 @@ $.widget( "ui.checkboxradio", { | |
| if ( this.options.label ){ | ||
| this.label.html( this.options.label ); | ||
| } | ||
|
|
||
| this._on({ | ||
| "change" : "_toggleClasses", | ||
| "focus": "_handleFocus", | ||
| "blur": "_handleBlur" | ||
| }); | ||
| }, | ||
|
|
||
| widget: function() { | ||
|
|
@@ -124,7 +128,6 @@ $.widget( "ui.checkboxradio", { | |
| // Check control.labels first | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's |
||
| if ( this.element[ 0 ].labels !== undefined ){ | ||
| this.label = $( this.element[ 0 ].labels ); | ||
| console.log( this.element[ 0 ].labels ); | ||
| } else { | ||
|
|
||
| // we don't search against the document in case the element | ||
|
|
@@ -154,7 +157,7 @@ $.widget( "ui.checkboxradio", { | |
| radioGroup( this.element[0] ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this even defined outside the widget? Could just make this an instance method |
||
| .not( this.element ) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indent this and the following lines. |
||
| .map(function() { | ||
| return $( this ).checkboxradio( "widget" )[ 0 ]; | ||
| return $( this ).checkboxradio( "widget" )[ 0 ]; | ||
| }) | ||
| .removeClass( "ui-state-active ui-radio-checked" ); | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everything is double-indented in this function.