r3351 committed - button: use full classname for icons
Revision: 3351
Author: joern.zaefferer
Date: Thu Oct 1 13:24:18 2009
Log: button: use full classname for icons
http://code.google.com/p/jquery-ui/source/detail?r=3351
Modified:
/branches/dev/tests/visual/button/default.html
/branches/dev/ui/jquery.ui.button.js
=======================================
--- /branches/dev/tests/visual/button/default.html Thu Oct 1 12:56:55 2009
+++ /branches/dev/tests/visual/button/default.html Thu Oct 1 13:24:18 2009
@@ -45,10 +45,10 @@
</div>
<div>
With icon
- <button class="{button:{icons:{primary:'locked'},text:false}}">Button
with icon only</button>
- <button class="{button:{icons:{primary:'locked'}}}">Button with icon on
the left</button>
- <button
class="{button:{icons:{primary:'locked',secondary:'scissors'}}}">Button
with two icons</button>
- <button
class="{button:{icons:{primary:'locked',secondary:'scissors'},text:false}}">Button
with two icons</button>
+ <button
class="{button:{icons:{primary:'ui-icon-locked'},text:false}}">Button with
icon only</button>
+ <button class="{button:{icons:{primary:'ui-icon-locked'}}}">Button with
icon on the left</button>
+ <button
class="{button:{icons:{primary:'ui-icon-locked',secondary:'ui-icon-scissors'}}}">Button
with two icons</button>
+ <button
class="{button:{icons:{primary:'ui-icon-locked',secondary:'ui-icon-scissors'},text:false}}">Button
with two icons</button>
</div>
</div>
@@ -64,9 +64,9 @@
<div id="toolbar" class="ui-widget-header ui-corner-all
ui-helper-clearfix">
<span id="ops1">
- <button
class="{button:{icons:{primary:'folder-open'},text:false}}">Open</button>
- <button
class="{button:{icons:{primary:'disk'},text:false}}">Save</button>
- <button
class="{button:{icons:{primary:'trash'},text:false}}">Delete</button>
+ <button
class="{button:{icons:{primary:'ui-icon-folder-open'},text:false}}">Open</button>
+ <button
class="{button:{icons:{primary:'ui-icon-disk'},text:false}}">Save</button>
+ <button
class="{button:{icons:{primary:'ui-icon-trash'},text:false}}">Delete</button>
</span>
<span id="format">
<input type="checkbox" id="check1" /><label for="check1">B</label>
@@ -74,8 +74,8 @@
<input type="checkbox" id="check3" /><label for="check3">U</label>
</span>
<span id="ops2">
- <button
class="{button:{icons:{primary:'print'},text:false}}">Print...</button>
- <button class="{button:{icons:{primary:'mail-closed'},text:false}}">Mail
to...</button>
+ <button
class="{button:{icons:{primary:'ui-icon-print'},text:false}}">Print...</button>
+ <button
class="{button:{icons:{primary:'ui-icon-mail-closed'},text:false}}">Mail
to...</button>
</span>
<span id="mode">
<input type="radio" id="mode1" name="radio" /><label
for="mode1">Edit</label>
=======================================
--- /branches/dev/ui/jquery.ui.button.js Thu Oct 1 12:56:55 2009
+++ /branches/dev/ui/jquery.ui.button.js Thu Oct 1 13:24:18 2009
@@ -26,10 +26,10 @@
this.element.addClass("ui-button-text-icon");
}
if (icons.primary) {
- this.element.prepend("<span class='ui-button-icon-primary ui-icon
ui-icon-" + icons.primary + "'></span>");
+ this.element.prepend("<span class='ui-button-icon-primary ui-icon " +
icons.primary + "'></span>");
}
if (icons.secondary) {
- this.element.append("<span class='ui-button-icon-secondary ui-icon
ui-icon-" + icons.secondary + "'></span>");
+ this.element.append("<span class='ui-button-icon-secondary ui-icon " +
icons.secondary + "'></span>");
}
if (!this.options.text) {
this.element.addClass(icons.primary &&
icons.secondary ? "ui-button-icons-only" : "ui-button-icon-only").removeClass("ui-button-text-icons
ui-button-text-icon");