-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Button Re-write #1513
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 Re-write #1513
Changes from all commits
6e70f94
79d312f
0203326
25d0c85
6e2bbca
40a9d1d
897ec38
9f7f0a4
dbf4172
7fdf575
db6a878
00d67bd
f11a100
f22c265
a504705
65af870
040dff6
14d97f3
daa3cd1
f783897
21c8d79
30c1955
dc178e8
e2c566c
5de82d0
e97c50e
e8f056d
58d876e
22d53d6
3155751
caaf4b5
6a16927
5010c7e
1cd3259
54cfaaa
9f3a5ee
56d426e
944d654
77ae5f9
be88320
39deb6e
a3919dd
424f517
2cafee9
7591c5f
3e1c4c3
df4b2e5
8da05d9
6fdc73c
5f0b3d1
77e48a9
c2c2915
754b6f0
f5a4ab6
e84b815
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,44 +5,59 @@ | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>jQuery UI Button - Icons</title> | ||
<link rel="stylesheet" href="../../themes/base/all.css"> | ||
<script src="../../external/jquery/jquery.js"></script> | ||
<script src="../../ui/core.js"></script> | ||
<script src="../../ui/widget.js"></script> | ||
<script src="../../ui/button.js"></script> | ||
<link rel="stylesheet" href="../demos.css"> | ||
<script> | ||
$(function() { | ||
$( "button:first" ).button({ | ||
icons: { | ||
primary: "ui-icon-locked" | ||
}, | ||
text: false | ||
}).next().button({ | ||
icons: { | ||
primary: "ui-icon-locked" | ||
} | ||
}).next().button({ | ||
icons: { | ||
primary: "ui-icon-gear", | ||
secondary: "ui-icon-triangle-1-s" | ||
} | ||
}).next().button({ | ||
icons: { | ||
primary: "ui-icon-gear", | ||
secondary: "ui-icon-triangle-1-s" | ||
}, | ||
text: false | ||
}); | ||
}); | ||
<script src="../../external/requirejs/require.js"></script> | ||
<script src="../bootstrap.js"> | ||
$( ".widget button" ) | ||
.eq( 0 ).button() | ||
.end().eq( 1 ).button( { | ||
icon: "ui-icon-gear", | ||
showLabel: false | ||
} ).end().eq( 2 ).button( { | ||
icon: "ui-icon-gear" | ||
} ).end().eq( 3 ).button( { | ||
icon: "ui-icon-gear", | ||
iconPosition: "end" | ||
} ).end().eq( 4 ).button( { | ||
icon: "ui-icon-gear", | ||
iconPosition: "top" | ||
} ).end().eq( 5 ).button( { | ||
icon: "ui-icon-gear", | ||
iconPosition: "bottom" | ||
} ); | ||
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. I know the style was already like this, but let's make this follow our actual indentation rules. It's probably a lot easier if you use |
||
</script> | ||
</head> | ||
<body> | ||
|
||
<button>Button with icon only</button> | ||
<button>Button with icon on the left</button> | ||
<button>Button with two icons</button> | ||
<button>Button with two icons and no text</button> | ||
|
||
<div class="widget"> | ||
<h1>Widget</h1> | ||
<button>Button with only text</button> | ||
<button>Button with icon only</button> | ||
<button>Button with icon on the left</button> | ||
<button>Button with icon on the right</button> | ||
<button>Button with icon on the top</button> | ||
<button>Button with icon on the bottom</button> | ||
</div> | ||
<div class="css"> | ||
<h1>CSS</h1> | ||
<button class="ui-button ui-widget ui-corner-all"> | ||
Button with only text | ||
</button> | ||
<button class="ui-button ui-widget ui-corner-all ui-button-icon-only" title="Button with icon only"> | ||
<span class="ui-icon ui-icon-gear"></span> Button with icon only | ||
</button> | ||
<button class="ui-button ui-widget ui-corner-all"> | ||
<span class="ui-icon ui-icon-gear"></span> Button with icon on the left | ||
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. The equivalent JS button also gets the "ui-button-icon" class on the icon span, and uses 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. These classes don't do anything they are just part of the classes option 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. Then this should be correct: https://github.com/jquery/api.jqueryui.com/pull/280/files#diff-bf14c9f5ccd16aa682040e25fcc9231eR19 |
||
</button> | ||
<button class="ui-button ui-widget ui-corner-all"> | ||
Button with icon on the right <span class="ui-icon ui-icon-gear"></span> | ||
</button> | ||
<button class="ui-button ui-widget ui-corner-all"> | ||
<span class="ui-icon ui-icon-gear ui-widget-icon-block"></span> Button with icon on the top | ||
</button> | ||
<button class="ui-button ui-widget ui-corner-all"> | ||
Button with icon on the bottom <span class="ui-icon ui-icon-gear ui-widget-icon-block"></span> | ||
</button> | ||
</div> | ||
<div class="demo-description"> | ||
<p>Some buttons with various combinations of text and icons.</p> | ||
</div> | ||
|
This file was deleted.
This file was deleted.
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.
Why not keep the chaining?
Also, this may just be personal preference, but I think
$( ".widget" ).find( "button, input, a" )
is easier to read.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.
Ignore the chaining comment, I see why you did that now that I've looked at the full diff.