r3529 committed - buttons: handle more children-types; default visual test for buttons: ...
Revision: 3529
Author: joern.zaefferer
Date: Wed Dec 23 10:32:28 2009
Log: buttons: handle more children-types; default visual test for buttons:
adding :submit, :reset and an anchor
http://code.google.com/p/jquery-ui/source/detail?r=3529
Modified:
/branches/dev/tests/visual/button/default.html
/branches/dev/ui/jquery.ui.button.js
=======================================
--- /branches/dev/tests/visual/button/default.html Wed Dec 16 18:23:07 2009
+++ /branches/dev/tests/visual/button/default.html Wed Dec 23 10:32:28 2009
@@ -13,7 +13,7 @@
<script type="text/javascript"
src="../../../ui/jquery.ui.tooltip.js"></script>
<script type="text/javascript">
$(function() {
- var selection = $("#push button, #ops1, #ops2, #format, #radio, #mode,
#toggle");
+ var selection = $("#push button, #ops1, #ops2, #format, #radio, #mode,
#toggle, #others");
selection.click(function(event) {
$("<div/>").text("Clicked " + $(event.target).text() + " (#" +
event.target.id + ")").appendTo("#log");
@@ -87,6 +87,12 @@
</span>
</div>
+<div id="others" style="margin-top: 2em;">
+ <input type="submit" value="Submit button" />
+ <input type="reset" value="Reset button" />
+ <a href="#">Anchor</a>
+</div>
+
<div style="margin-top: 2em;">
<button id="disable-widgets">Toggle disabled</button>
<button id="toggle-widgets">Toggle widget</button>
=======================================
--- /branches/dev/ui/jquery.ui.button.js Wed Dec 23 10:09:04 2009
+++ /branches/dev/ui/jquery.ui.button.js Wed Dec 23 10:32:28 2009
@@ -212,7 +212,7 @@
$.widget("ui.buttons", {
_init: function() {
- var buttons = this.buttons = this.element.find("button").button();
+ var buttons = this.buttons = this.element.find("button, :submit, :reset,
a").button();
if (!buttons.length) {
this.toggle = this.element.find(":checkbox").toggleButton();
buttons = this.toggle.next();
--