Browse files

Merge branch 'master' into grid

  • Loading branch information...
2 parents 97d8a2b + fe3b36b commit fc70ad72e3e6a988a3c78d30d2ffd99367fab8aa @jzaefferer jzaefferer committed Apr 29, 2011
Showing with 1,852 additions and 1,359 deletions.
  1. +4 −4 demos/demos.css
  2. +4 −5 demos/tabs/ajax.html
  3. +0 −1 demos/tabs/bottom.html
  4. +7 −1 demos/tabs/sortable.html
  5. +1 −1 demos/tabs/vertical.html
  6. +5 −2 demos/tooltip/custom-animation.html
  7. +1 −0 demos/tooltip/index.html
  8. +6 −7 demos/tooltip/tracking.html
  9. +0 −172 tests/static/menu/all-menus-icons.html
  10. +0 −39 tests/static/menu/default.html
  11. +1 −1 tests/unit/accordion/accordion.html
  12. +14 −14 tests/unit/accordion/accordion_core.js
  13. +6 −1 tests/unit/accordion/accordion_defaults.js
  14. +8 −1 tests/unit/accordion/accordion_defaults_deprecated.js
  15. +1 −1 tests/unit/accordion/accordion_deprecated.html
  16. +99 −99 tests/unit/accordion/accordion_deprecated.js
  17. +29 −29 tests/unit/accordion/accordion_events.js
  18. +13 −13 tests/unit/accordion/accordion_methods.js
  19. +111 −111 tests/unit/accordion/accordion_options.js
  20. +24 −18 tests/unit/autocomplete/autocomplete_defaults.js
  21. +12 −13 tests/unit/button/button_defaults.js
  22. +33 −34 tests/unit/dialog/dialog_defaults.js
  23. +2 −2 tests/unit/dialog/dialog_options.js
  24. +10 −11 tests/unit/menu/menu_defaults.js
  25. +9 −10 tests/unit/progressbar/progressbar_defaults.js
  26. +17 −0 tests/unit/progressbar/progressbar_options.js
  27. +18 −19 tests/unit/slider/slider_defaults.js
  28. +14 −15 tests/unit/spinner/spinner_defaults.js
  29. +48 −1 tests/unit/tabs/tabs.html
  30. +16 −0 tests/unit/tabs/tabs_core.js
  31. +6 −3 tests/unit/tabs/tabs_defaults.js
  32. +13 −10 tests/unit/tabs/tabs_defaults_deprecated.js
  33. +48 −1 tests/unit/tabs/tabs_deprecated.html
  34. +94 −58 tests/unit/tabs/tabs_deprecated.js
  35. +128 −132 tests/unit/tabs/tabs_methods.js
  36. +124 −45 tests/unit/tabs/tabs_options.js
  37. +0 −62 tests/unit/tabs/tabs_tickets.js
  38. +13 −14 tests/unit/tooltip/tooltip_defaults.js
  39. +3 −0 tests/unit/widget/widget_core.js
  40. +41 −3 tests/visual/menu/menu.html
  41. +120 −96 tests/visual/menu/menubar.html
  42. +84 −39 tests/visual/menu/menubar.js
  43. +159 −0 tests/visual/menu/popup.html
  44. +124 −0 tests/visual/menu/popup.js
  45. +15 −10 tests/visual/tooltip/tooltip.html
  46. +12 −5 themes/base/jquery.ui.menu.css
  47. +6 −1 themes/base/jquery.ui.resizable.css
  48. +1 −1 ui/i18n/jquery.ui.datepicker-nl.js
  49. +1 −1 ui/i18n/jquery.ui.datepicker-sk.js
  50. +24 −25 ui/jquery.effects.core.js
  51. +10 −1 ui/jquery.ui.accordion.js
  52. +10 −1 ui/jquery.ui.autocomplete.js
  53. +25 −21 ui/jquery.ui.core.js
  54. +62 −38 ui/jquery.ui.menu.js
  55. +1 −0 ui/jquery.ui.progressbar.js
  56. +143 −104 ui/jquery.ui.tabs.js
  57. +68 −62 ui/jquery.ui.tooltip.js
  58. +4 −1 ui/jquery.ui.widget.js
View
8 demos/demos.css
@@ -320,10 +320,10 @@ div.demo-description {
#widget-docs .ui-tabs-nav li a:hover,
#widget-docs .ui-tabs-nav li a:active { font-size:14px; padding:4px 1.2em 3px; color:#fff; }
-#widget-docs .ui-tabs-nav li.ui-tabs-selected a:link,
-#widget-docs .ui-tabs-nav li.ui-tabs-selected a:visited,
-#widget-docs .ui-tabs-nav li.ui-tabs-selected a:hover,
-#widget-docs .ui-tabs-nav li.ui-tabs-selected a:active { color:#e6820E; }
+#widget-docs .ui-tabs-nav li.ui-tabs-active a:link,
+#widget-docs .ui-tabs-nav li.ui-tabs-active a:visited,
+#widget-docs .ui-tabs-nav li.ui-tabs-active a:hover,
+#widget-docs .ui-tabs-nav li.ui-tabs-active a:active { color:#e6820E; }
#widget-docs .ui-tabs-panel { padding:20px 9px; font-size:12px; line-height:1.4; color:#000; }
View
9 demos/tabs/ajax.html
@@ -12,13 +12,12 @@
<script>
$(function() {
$( "#tabs" ).tabs({
- ajaxOptions: {
- error: function( xhr, status, index, anchor ) {
- var selector = $( anchor ).attr( "aria-controls" );
- $( selector ).html(
+ beforeLoad: function( event, ui ) {
+ ui.jqXHR.error(function() {
+ ui.panel.html(
"Couldn't load this tab. We'll try to fix this as soon as possible. " +
"If this wouldn't be a demo." );
- }
+ });
}
});
});
View
1 demos/tabs/bottom.html
@@ -23,7 +23,6 @@
.tabs-bottom .ui-tabs-panel { height: 140px; overflow: auto; }
.tabs-bottom .ui-tabs-nav { position: absolute !important; left: 0; bottom: 0; right:0; padding: 0 0.2em 0.2em 0; }
.tabs-bottom .ui-tabs-nav li { margin-top: -2px !important; margin-bottom: 1px !important; border-top: none; border-bottom-width: 1px; }
- .ui-tabs-selected { margin-top: -3px !important; }
</style>
</head>
<body>
View
8 demos/tabs/sortable.html
@@ -13,7 +13,13 @@
<link rel="stylesheet" href="../demos.css">
<script>
$(function() {
- $( "#tabs" ).tabs().find( ".ui-tabs-nav" ).sortable({ axis: "x" });
+ var tabs = $( "#tabs" ).tabs();
+ tabs.find( ".ui-tabs-nav" ).sortable({
+ axis: "x",
+ stop: function() {
+ tabs.tabs( "refresh" );
+ }
+ });
});
</script>
</head>
View
2 demos/tabs/vertical.html
@@ -20,7 +20,7 @@
.ui-tabs-vertical .ui-tabs-nav { padding: .2em .1em .2em .2em; float: left; width: 12em; }
.ui-tabs-vertical .ui-tabs-nav li { clear: left; width: 100%; border-bottom-width: 1px !important; border-right-width: 0 !important; margin: 0 -1px .2em 0; }
.ui-tabs-vertical .ui-tabs-nav li a { display:block; }
- .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-selected { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
+ .ui-tabs-vertical .ui-tabs-nav li.ui-tabs-active { padding-bottom: 0; padding-right: .1em; border-right-width: 1px; border-right-width: 1px; }
.ui-tabs-vertical .ui-tabs-panel { padding: 1em; float: right; width: 40em;}
</style>
</head>
View
7 demos/tooltip/custom-animation.html
@@ -11,12 +11,15 @@
<link type="text/css" href="../demos.css" rel="stylesheet" />
<script type="text/javascript">
$(function() {
+ // TODO overhaul this with custom animation API
$(".demo").tooltip({
open: function() {
- $(this).tooltip("widget").stop(false, true).hide().slideDown();
+ $(".ui-tooltip").stop(false, true).hide().slideDown();
},
close: function() {
- $(this).tooltip("widget").stop(false, true).show().slideUp();
+ $(".ui-tooltip").stop(false, false).show().slideUp(function() {
+ $(this).remove();
+ });
}
});
});
View
1 demos/tooltip/index.html
@@ -14,6 +14,7 @@
<li><a href="tracking.html">Track the mouse</a></li>
<li><a href="custom-animation.html">Custom animation</a></li>
<li><a href="delegation-mixbag.html">Delegation Mixbag</a></li>
+ <li><a href="lots.html">Lots</a></li>
</ul>
</div>
View
13 demos/tooltip/tracking.html
@@ -13,20 +13,19 @@
$(function() {
$(".demo").tooltip({
open: function() {
- var tooltip = $(this).tooltip("widget");
- $(document).mousemove(function(event) {
- tooltip.position({
- my: "left center",
- at: "right center",
- offset: "25 25",
+ var tooltip = $( ".ui-tooltip" );
+ $(document).mousemove(function( event ) {
+ tooltip.position( {
+ my: "left+25 center",
+ at: "right+25 center",
of: event
});
})
// trigger once to override element-relative positioning
.mousemove();
},
close: function() {
- $(document).unbind("mousemove");
+ $(document).unbind( "mousemove" );
}
});
});
View
172 tests/static/menu/all-menus-icons.html
@@ -1,172 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8" />
- <title>Menu Static Test : Default</title>
- <link rel="stylesheet" href="../static.css" type="text/css" />
- <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
- <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
- <script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
- <script type="text/javascript" src="../static.js"></script>
-
- <script src="http://jqueryui.com/themeroller/themeswitchertool/" type="text/javascript"></script>
- <script>
- $(document).ready(function(){
- $('#switcher').themeswitcher();
- });
- </script>
-
-
-
- <style type="text/css">
-/* styles for this page only */
-.ui-menu { width: 200px; }
-#flyout .ui-menu { position: relative; }
-#flyout .ui-menu.ui-menu-icons { position: absolute; }
-
-.ui-menu.ui-menu-icons { position: relative; }
-.ui-menu.ui-menu-icons .ui-menu-item a { position: relative; padding-left: 2em; }
-
-/* left-aligned icon */
-.ui-menu .ui-icon { position: absolute; top: .2em; left: .2em; }
-
-/* right-aligned icon */
-.ui-menu .ui-icon.ui-menu-icon { position: static; float: right; }
- </style>
-
-</head>
-<body>
-
-<div id="switcher" style="position: absolute; top: 20px; right: 20px;"></div>
-
-
-<!-- NOTES:
-
-* Added "ui-menu-icons" class to set a left indent value for all menu items in a single menu
-
--->
-
-
-<h2>Default</h2>
-
-<ul role="menu" aria-activedescendant="ui-active-menuitem" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-bottom">
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-print"></span>Aberdeen</a></li>
- <li class="ui-menu-item" role="menuitem" id="ui-active-menuitem"><a href="#" tabindex="-1" class="ui-state-hover ui-corner-all">Ada</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adamsville</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-scissors"></span>Addyston really long menu option to show wrap</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-wrench"></span>Adelphi</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all"><span class="ui-icon ui-icon-star"></span>Adena</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adrian</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Akron</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Albany</a></li>
-</ul>
-
-<br /><br />
-
-<div id="drilldown">
-
-<h2>Drilldown</h2>
-
-<ul role="listbox" aria-activedescendant="ui-active-menuitem" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
- <li role="menuitem" class="ui-menu-item">
- <a href="#" tabindex="-1" class="ui-state-hover ui-corner-all"><span class="ui-icon ui-icon-print"></span><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Amsterdam</a>
- <ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Aberdeen</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Ada</a></li>
- <li role="menuitem" class="ui-menu-item">
- <a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Adamsville</a>
- <ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Anaheim</a></li>
- <li role="menuitem" class="ui-menu-item">
- <a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Cologne</a>
- <ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Frankfurt</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Addyston</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Amesville</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-star"></span>Anaheim</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-heart"></span>Cologne</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-key"></span>Frankfurt</a></li>
- <li role="menuitem" class="ui-menu-item">
- <a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Magdeburg</a>
- <ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-widget ui-widget-content ui-corner-all" style="display: none;">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Munich</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Utrecht</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Zurich</a></li>
-</ul>
-
-</div>
-
-<br /><br />
-
-<div id="flyout">
-
-<h2>Flyout / nested</h2>
-
-<ul aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all" id="menu">
- <li role="menuitem" class="ui-menu-item">
- <a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-scissors"></span>Amsterdam</a>
- <ul style="display: block; top: 88.5px; left: 205px;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Aberdeen</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Ada</a></li>
- <li role="menuitem" class="ui-menu-item">
- <a tabindex="-1" class="ui-state-active ui-corner-all" href="#"><span class="ui-icon ui-icon-print"></span><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Adamsville</a>
- <ul style="display: block; top: 73px; left: -11px; z-index: 9999;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Anaheim</a></li>
- <li role="menuitem" class="ui-menu-item">
- <a tabindex="-1" class="ui-corner-all" href="#">Cologne</a>
- <ul style="display: none;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-state-hover ui-corner-all" href="#">Frankfurt</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Addyston</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Amesville</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Anaheim</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-pencil"></span>Cologne</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-clock"></span>Frankfurt</a></li>
- <li role="menuitem" class="ui-menu-item">
- <a tabindex="-1" class="ui-state-active ui-corner-all" href="#"><span class="ui-icon ui-icon-print"></span><span class="ui-icon ui-menu-icon ui-icon-carat-1-e"></span>Magdeburg</a>
- <ul style="display: none;" aria-activedescendant="ui-active-menuitem" role="listbox" class="ui-menu ui-menu-icons ui-widget ui-widget-content ui-corner-all">
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mberdeen</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mda</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mdamsville</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mddyston</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Mmesville</a></li>
- </ul>
- </li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-lightbulb"></span>Munich</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#"><span class="ui-icon ui-icon-clipboard"></span>Utrecht</a></li>
- <li role="menuitem" class="ui-menu-item"><a tabindex="-1" class="ui-corner-all" href="#">Zurich</a></li>
-</ul>
-
-</div>
-
-
-</body>
-</html>
View
39 tests/static/menu/default.html
@@ -1,39 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="UTF-8" />
- <title>Menu Static Test : Default</title>
- <link rel="stylesheet" href="../static.css" type="text/css" />
- <link rel="stylesheet" href="../../../themes/base/jquery.ui.base.css" type="text/css" />
- <link rel="stylesheet" href="../../../themes/base/jquery.ui.theme.css" type="text/css" title="ui-theme" />
- <script type="text/javascript" src="../../../jquery-1.5.1.js"></script>
- <script type="text/javascript" src="../static.js"></script>
-
-</head>
-<body>
-
-
-<ul role="menu" aria-activedescendant="ui-active-menuitem" class="ui-menu ui-widget ui-widget-content ui-corner-bottom">
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Aberdeen</a></li>
- <li class="ui-menu-item" role="menuitem" id="ui-active-menuitem"><a href="#" tabindex="-1" class="ui-state-hover ui-corner-all">Ada</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adamsville</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Addyston</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adelphi</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adena</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Adrian</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Akron</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Albany</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Alexandria</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Alger</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Alledonia</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Alliance</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Alpha</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Alvada</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Alvordton</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Amanda</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Amelia</a></li>
- <li class="ui-menu-item" role="menuitem"><a href="#" tabindex="-1" class="ui-corner-all">Amesville</a></li>
-</ul>
-
-</body>
-</html>
View
2 tests/unit/accordion/accordion.html
@@ -20,7 +20,7 @@
<script src="../testsuite.js"></script>
<script>
- function state( accordion ) {
+ function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
View
28 tests/unit/accordion/accordion_core.js
@@ -4,46 +4,46 @@ module( "accordion: core", accordionSetupTeardown() );
$.each( { div: "#list1", ul: "#navigation", dl: "#accordion-dl" }, function( type, selector ) {
test( "markup structure: " + type, function() {
- var ac = $( selector ).accordion();
- ok( ac.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
- equal( ac.find( ".ui-accordion-header" ).length, 3,
+ var element = $( selector ).accordion();
+ ok( element.hasClass( "ui-accordion" ), "main element is .ui-accordion" );
+ equal( element.find( ".ui-accordion-header" ).length, 3,
".ui-accordion-header elements exist, correct number" );
- equal( ac.find( ".ui-accordion-content" ).length, 3,
+ equal( element.find( ".ui-accordion-content" ).length, 3,
".ui-accordion-content elements exist, correct number" );
- same( ac.find( ".ui-accordion-header" ).next().get(),
- ac.find( ".ui-accordion-content" ).get(),
+ same( element.find( ".ui-accordion-header" ).next().get(),
+ element.find( ".ui-accordion-content" ).get(),
"content panels come immediately after headers" );
});
});
test( "handle click on header-descendant", function() {
- var ac = $( "#navigation" ).accordion();
+ var element = $( "#navigation" ).accordion();
$( "#navigation h2:eq(1) a" ).click();
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 1, 0 );
});
test( "ui-accordion-heading class added to headers anchor", function() {
expect( 1 );
- var ac = $( "#list1" ).accordion();
- var anchors = $( ".ui-accordion-heading" );
+ var element = $( "#list1" ).accordion();
+ var anchors = element.find( ".ui-accordion-heading" );
equals( anchors.length, 3 );
});
test( "accessibility", function () {
expect( 13 );
- var ac = $( "#list1" ).accordion().accordion( "option", "active", 1 );
- var headers = $( ".ui-accordion-header" );
+ var element = $( "#list1" ).accordion().accordion( "option", "active", 1 );
+ var headers = element.find( ".ui-accordion-header" );
equals( headers.eq( 1 ).attr( "tabindex" ), 0, "active header should have tabindex=0" );
equals( headers.eq( 0 ).attr( "tabindex" ), -1, "inactive header should have tabindex=-1" );
- equals( ac.attr( "role" ), "tablist", "main role" );
+ equals( element.attr( "role" ), "tablist", "main role" );
equals( headers.attr( "role" ), "tab", "tab roles" );
equals( headers.next().attr( "role" ), "tabpanel", "tabpanel roles" );
equals( headers.eq( 1 ).attr( "aria-expanded" ), "true", "active tab has aria-expanded" );
equals( headers.eq( 0 ).attr( "aria-expanded" ), "false", "inactive tab has aria-expanded" );
equals( headers.eq( 1 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
equals( headers.eq( 0 ).attr( "aria-selected" ), "false", "inactive tab has aria-selected" );
- ac.accordion( "option", "active", 0 );
+ element.accordion( "option", "active", 0 );
equals( headers.eq( 0 ).attr( "aria-expanded" ), "true", "newly active tab has aria-expanded" );
equals( headers.eq( 1 ).attr( "aria-expanded" ), "false", "newly inactive tab has aria-expanded" );
equals( headers.eq( 0 ).attr( "aria-selected" ), "true", "active tab has aria-selected" );
View
7 tests/unit/accordion/accordion_defaults.js
@@ -10,6 +10,11 @@ commonWidgetTests( "accordion", {
icons: {
"activeHeader": "ui-icon-triangle-1-s",
"header": "ui-icon-triangle-1-e"
- }
+ },
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ create: null
}
});
View
9 tests/unit/accordion/accordion_defaults_deprecated.js
@@ -16,6 +16,13 @@ commonWidgetTests( "accordion", {
"headerSelected": "ui-icon-triangle-1-s"
},
navigation: false,
- navigationFilter: function() {}
+ navigationFilter: function() {},
+
+ // callbacks
+ activate: null,
+ beforeActivate: null,
+ change: null,
+ changestart: null,
+ create: null
}
});
View
2 tests/unit/accordion/accordion_deprecated.html
@@ -17,7 +17,7 @@
<script src="../testsuite.js"></script>
<script>
- function state( accordion ) {
+ function accordion_state( accordion ) {
var expected = $.makeArray( arguments ).slice( 1 );
var actual = accordion.find( ".ui-accordion-content" ).map(function() {
return $( this ).css( "display" ) === "none" ? 0 : 1;
View
198 tests/unit/accordion/accordion_deprecated.js
@@ -3,89 +3,89 @@
module( "accordion (deprecated): expanded active option, activate method", accordionSetupTeardown() );
test( "activate, numeric", function() {
- var ac = $( "#list1" ).accordion({ active: 1 });
- state( ac, 0, 1, 0 );
- ac.accordion( "activate", 2 );
- state( ac, 0, 0, 1 );
- ac.accordion( "activate", 0 );
- state( ac, 1, 0, 0 );
- ac.accordion( "activate", 1 );
- state( ac, 0, 1, 0 );
- ac.accordion( "activate", 2 );
- state( ac, 0, 0, 1 );
+ var element = $( "#list1" ).accordion({ active: 1 });
+ accordion_state( element, 0, 1, 0 );
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", 0 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", 1 );
+ accordion_state( element, 0, 1, 0 );
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
});
test( "activate, numeric, collapsible:true", function() {
- var ac = $( "#list1" ).accordion({ collapsible: true });
- ac.accordion( "activate", 2 );
- state( ac, 0, 0, 1 );
- ac.accordion( "activate", 0 );
- state( ac, 1, 0, 0 );
- ac.accordion( "activate", -1 );
- state( ac, 0, 0, 0 );
+ var element = $( "#list1" ).accordion({ collapsible: true });
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", 0 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", -1 );
+ accordion_state( element, 0, 0, 0 );
});
test( "activate, boolean, collapsible: true", function() {
- var ac = $( "#list1" ).accordion({ collapsible: true });
- ac.accordion( "activate", 2 );
- state( ac, 0, 0, 1 );
- ac.accordion( "activate", false );
- state( ac, 0, 0, 0 );
+ var element = $( "#list1" ).accordion({ collapsible: true });
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", false );
+ accordion_state( element, 0, 0, 0 );
});
test( "activate, boolean, collapsible: false", function() {
- var ac = $( "#list1" ).accordion();
- ac.accordion( "activate", 2 );
- state( ac, 0, 0, 1 );
- ac.accordion( "activate", false );
- state( ac, 0, 0, 1 );
+ var element = $( "#list1" ).accordion();
+ element.accordion( "activate", 2 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", false );
+ accordion_state( element, 0, 0, 1 );
});
test( "activate, string expression", function() {
- var ac = $( "#list1" ).accordion({ active: "h3:last" });
- state( ac, 0, 0, 1 );
- ac.accordion( "activate", ":first" );
- state( ac, 1, 0, 0 );
- ac.accordion( "activate", ":eq(1)" );
- state( ac, 0, 1, 0 );
- ac.accordion( "activate", ":last" );
- state( ac, 0, 0, 1 );
+ var element = $( "#list1" ).accordion({ active: "h3:last" });
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", ":first" );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", ":eq(1)" );
+ accordion_state( element, 0, 1, 0 );
+ element.accordion( "activate", ":last" );
+ accordion_state( element, 0, 0, 1 );
});
test( "activate, jQuery or DOM element", function() {
- var ac = $( "#list1" ).accordion({ active: $( "#list1 h3:last" ) });
- state( ac, 0, 0, 1 );
- ac.accordion( "activate", $( "#list1 h3:first" ) );
- state( ac, 1, 0, 0 );
- ac.accordion( "activate", $( "#list1 h3" )[ 1 ] );
- state( ac, 0, 1, 0 );
+ var element = $( "#list1" ).accordion({ active: $( "#list1 h3:last" ) });
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "activate", $( "#list1 h3:first" ) );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "activate", $( "#list1 h3" )[ 1 ] );
+ accordion_state( element, 0, 1, 0 );
});
test( "{ active: Selector }", function() {
- var ac = $("#list1").accordion({
+ var element = $("#list1").accordion({
active: "h3:last"
});
- state( ac, 0, 0, 1 );
- ac.accordion( "option", "active", "h3:eq(1)" );
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "option", "active", "h3:eq(1)" );
+ accordion_state( element, 0, 1, 0 );
});
test( "{ active: Element }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: $( "#list1 h3:last" )[ 0 ]
});
- state( ac, 0, 0, 1 );
- ac.accordion( "option", "active", $( "#list1 h3:eq(1)" )[ 0 ] );
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "option", "active", $( "#list1 h3:eq(1)" )[ 0 ] );
+ accordion_state( element, 0, 1, 0 );
});
test( "{ active: jQuery Object }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: $( "#list1 h3:last" )
});
- state( ac, 0, 0, 1 );
- ac.accordion( "option", "active", $( "#list1 h3:eq(1)" ) );
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 0, 1 );
+ element.accordion( "option", "active", $( "#list1 h3:eq(1)" ) );
+ accordion_state( element, 0, 1, 0 );
});
@@ -99,9 +99,9 @@ test( "{ autoHeight: true }, default", function() {
});
test("{ autoHeight: false }", function() {
- var accordion = $('#navigation').accordion({ autoHeight: false });
+ var element = $('#navigation').accordion({ autoHeight: false });
var sizes = [];
- accordion.find(".ui-accordion-content").each(function() {
+ element.find(".ui-accordion-content").each(function() {
sizes.push($(this).height());
});
ok( sizes[0] >= 70 && sizes[0] <= 105, "was " + sizes[0] );
@@ -111,8 +111,8 @@ test("{ autoHeight: false }", function() {
test( "{ fillSpace: true }", function() {
$( "#navigationWrapper" ).height( 500 );
- var ac = $( "#navigation" ).accordion({ fillSpace: true });
- equalHeights( ac, 446, 458 );
+ var element = $( "#navigation" ).accordion({ fillSpace: true });
+ equalHeights( element, 446, 458 );
});
test( "{ fillSapce: true } with sibling", function() {
@@ -124,8 +124,8 @@ test( "{ fillSapce: true } with sibling", function() {
marginBottom: 30
})
.prependTo( "#navigationWrapper" );
- var ac = $( "#navigation" ).accordion({ fillSpace: true });
- equalHeights( ac , 346, 358);
+ var element = $( "#navigation" ).accordion({ fillSpace: true });
+ equalHeights( element , 346, 358);
});
test( "{ fillSpace: true } with multiple siblings", function() {
@@ -152,8 +152,8 @@ test( "{ fillSpace: true } with multiple siblings", function() {
marginBottom: 15
})
.prependTo( "#navigationWrapper" );
- var ac = $( "#navigation" ).accordion({ fillSpace: true });
- equalHeights( ac, 296, 308 );
+ var element = $( "#navigation" ).accordion({ fillSpace: true });
+ equalHeights( element, 296, 308 );
});
@@ -163,13 +163,13 @@ test( "{ fillSpace: true } with multiple siblings", function() {
module( "accordion (deprecated) - icons", accordionSetupTeardown() );
test( "icons, headerSelected", function() {
- var list = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
icons: { headerSelected: "a1", header: "h1" }
});
- ok( list.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
- list.accordion( "option", "icons", { headerSelected: "a2", header: "h2" } );
- ok( !list.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
- ok( list.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) );
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ element.accordion( "option", "icons", { headerSelected: "a2", header: "h2" } );
+ ok( !element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) );
});
@@ -179,18 +179,18 @@ test( "icons, headerSelected", function() {
module( "accordion (deprecated) - resize", accordionSetupTeardown() );
test( "resize", function() {
- var expected = $( "#navigation" )
+ var element = $( "#navigation" )
.parent()
.height( 300 )
.end()
.accordion({
heightStyle: "fill"
});
- equalHeights( expected, 246, 258 );
+ equalHeights( element, 246, 258 );
- expected.parent().height( 500 );
- expected.accordion( "resize" );
- equalHeights( expected, 446, 458 );
+ element.parent().height( 500 );
+ element.accordion( "resize" );
+ equalHeights( element, 446, 458 );
});
@@ -200,25 +200,25 @@ test( "resize", function() {
module( "accordion (deprecated) - navigation", accordionSetupTeardown() );
test( "{ navigation: true, navigationFilter: header }", function() {
- var ac = $( "#navigation" ).accordion({
+ var element = $( "#navigation" ).accordion({
navigation: true,
navigationFilter: function() {
return /\?p=1\.1\.3$/.test( this.href );
}
});
- equal( ac.accordion( "option", "active" ), 2 );
- state( ac, 0, 0, 1 );
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
});
test( "{ navigation: true, navigationFilter: content }", function() {
- var ac = $("#navigation").accordion({
+ var element = $("#navigation").accordion({
navigation: true,
navigationFilter: function() {
return /\?p=1\.1\.3\.2$/.test(this.href);
}
});
- equal( ac.accordion( "option", "active" ), 2 );
- state( ac, 0, 0, 1 );
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
});
@@ -229,26 +229,26 @@ module( "accordion (deprecated) - changestart/change events", accordionSetupTear
test( "changestart", function() {
expect( 26 );
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: false,
collapsible: true
});
- var headers = ac.find( ".ui-accordion-header" );
- var content = ac.find( ".ui-accordion-content" );
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
- ac.one( "accordionchangestart", function( event, ui ) {
+ element.one( "accordionchangestart", function( event, ui ) {
equals( ui.oldHeader.size(), 0 );
equals( ui.oldContent.size(), 0 );
equals( ui.newHeader.size(), 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
equals( ui.newContent.size(), 1 );
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
- state( ac, 0, 0, 0 );
+ accordion_state( element, 0, 0, 0 );
});
- ac.accordion( "option", "active", 0 );
- state( ac, 1, 0, 0 );
+ element.accordion( "option", "active", 0 );
+ accordion_state( element, 1, 0, 0 );
- ac.one( "accordionchangestart", function( event, ui ) {
+ element.one( "accordionchangestart", function( event, ui ) {
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
equals( ui.oldContent.size(), 1 );
@@ -257,44 +257,44 @@ test( "changestart", function() {
strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
equals( ui.newContent.size(), 1 );
strictEqual( ui.newContent[ 0 ], content[ 1 ] );
- state( ac, 1, 0, 0 );
+ accordion_state( element, 1, 0, 0 );
});
headers.eq( 1 ).click();
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 1, 0 );
- ac.one( "accordionchangestart", function( event, ui ) {
+ element.one( "accordionchangestart", function( event, ui ) {
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
equals( ui.oldContent.size(), 1 );
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
equals( ui.newHeader.size(), 0 );
equals( ui.newContent.size(), 0 );
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 1, 0 );
});
- ac.accordion( "option", "active", false );
- state( ac, 0, 0, 0 );
+ element.accordion( "option", "active", false );
+ accordion_state( element, 0, 0, 0 );
});
test( "change", function() {
expect( 20 );
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: false,
collapsible: true
});
- var headers = ac.find( ".ui-accordion-header" );
- var content = ac.find( ".ui-accordion-content" );
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
- ac.one( "accordionchange", function( event, ui ) {
+ element.one( "accordionchange", function( event, ui ) {
equals( ui.oldHeader.size(), 0 );
equals( ui.oldContent.size(), 0 );
equals( ui.newHeader.size(), 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
equals( ui.newContent.size(), 1 );
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
});
- ac.accordion( "option", "active", 0 );
+ element.accordion( "option", "active", 0 );
- ac.one( "accordionchange", function( event, ui ) {
+ element.one( "accordionchange", function( event, ui ) {
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
equals( ui.oldContent.size(), 1 );
@@ -306,15 +306,15 @@ test( "change", function() {
});
headers.eq( 1 ).click();
- ac.one( "accordionchange", function( event, ui ) {
+ element.one( "accordionchange", function( event, ui ) {
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
equals( ui.oldContent.size(), 1 );
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
equals( ui.newHeader.size(), 0 );
equals( ui.newContent.size(), 0 );
});
- ac.accordion( "option", "active", false );
+ element.accordion( "option", "active", false );
});
})(jQuery);
View
58 tests/unit/accordion/accordion_events.js
@@ -4,27 +4,27 @@ module( "accordion: events", accordionSetupTeardown() );
test( "beforeActivate", function() {
expect( 38 );
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: false,
collapsible: true
});
- var headers = ac.find( ".ui-accordion-header" );
- var content = ac.find( ".ui-accordion-content" );
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
- ac.one( "accordionbeforeactivate", function( event, ui ) {
+ element.one( "accordionbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ) );
equals( ui.oldHeader.size(), 0 );
equals( ui.oldContent.size(), 0 );
equals( ui.newHeader.size(), 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
equals( ui.newContent.size(), 1 );
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
- state( ac, 0, 0, 0 );
+ accordion_state( element, 0, 0, 0 );
});
- ac.accordion( "option", "active", 0 );
- state( ac, 1, 0, 0 );
+ element.accordion( "option", "active", 0 );
+ accordion_state( element, 1, 0, 0 );
- ac.one( "accordionbeforeactivate", function( event, ui ) {
+ element.one( "accordionbeforeactivate", function( event, ui ) {
equals( event.originalEvent.type, "click" );
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
@@ -34,25 +34,25 @@ test( "beforeActivate", function() {
strictEqual( ui.newHeader[ 0 ], headers[ 1 ] );
equals( ui.newContent.size(), 1 );
strictEqual( ui.newContent[ 0 ], content[ 1 ] );
- state( ac, 1, 0, 0 );
+ accordion_state( element, 1, 0, 0 );
});
headers.eq( 1 ).click();
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 1, 0 );
- ac.one( "accordionbeforeactivate", function( event, ui ) {
+ element.one( "accordionbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ) );
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
equals( ui.oldContent.size(), 1 );
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
equals( ui.newHeader.size(), 0 );
equals( ui.newContent.size(), 0 );
- state( ac, 0, 1, 0 );
+ accordion_state( element, 0, 1, 0 );
});
- ac.accordion( "option", "active", false );
- state( ac, 0, 0, 0 );
+ element.accordion( "option", "active", false );
+ accordion_state( element, 0, 0, 0 );
- ac.one( "accordionbeforeactivate", function( event, ui ) {
+ element.one( "accordionbeforeactivate", function( event, ui ) {
ok( !( "originalEvent" in event ) );
equals( ui.oldHeader.size(), 0 );
equals( ui.oldContent.size(), 0 );
@@ -61,32 +61,32 @@ test( "beforeActivate", function() {
equals( ui.newContent.size(), 1 );
strictEqual( ui.newContent[ 0 ], content[ 2 ] );
event.preventDefault();
- state( ac, 0, 0, 0 );
+ accordion_state( element, 0, 0, 0 );
});
- ac.accordion( "option", "active", 2 );
- state( ac, 0, 0, 0 );
+ element.accordion( "option", "active", 2 );
+ accordion_state( element, 0, 0, 0 );
});
test( "activate", function() {
expect( 21 );
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: false,
collapsible: true
});
- var headers = ac.find( ".ui-accordion-header" );
- var content = ac.find( ".ui-accordion-content" );
+ var headers = element.find( ".ui-accordion-header" );
+ var content = element.find( ".ui-accordion-content" );
- ac.one( "accordionactivate", function( event, ui ) {
+ element.one( "accordionactivate", function( event, ui ) {
equals( ui.oldHeader.size(), 0 );
equals( ui.oldContent.size(), 0 );
equals( ui.newHeader.size(), 1 );
strictEqual( ui.newHeader[ 0 ], headers[ 0 ] );
equals( ui.newContent.size(), 1 );
strictEqual( ui.newContent[ 0 ], content[ 0 ] );
});
- ac.accordion( "option", "active", 0 );
+ element.accordion( "option", "active", 0 );
- ac.one( "accordionactivate", function( event, ui ) {
+ element.one( "accordionactivate", function( event, ui ) {
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 0 ] );
equals( ui.oldContent.size(), 1 );
@@ -98,25 +98,25 @@ test( "activate", function() {
});
headers.eq( 1 ).click();
- ac.one( "accordionactivate", function( event, ui ) {
+ element.one( "accordionactivate", function( event, ui ) {
equals( ui.oldHeader.size(), 1 );
strictEqual( ui.oldHeader[ 0 ], headers[ 1 ] );
equals( ui.oldContent.size(), 1 );
strictEqual( ui.oldContent[ 0 ], content[ 1 ] );
equals( ui.newHeader.size(), 0 );
equals( ui.newContent.size(), 0 );
});
- ac.accordion( "option", "active", false );
+ element.accordion( "option", "active", false );
// prevent activation
- ac.one( "accordionbeforeactivate", function( event ) {
+ element.one( "accordionbeforeactivate", function( event ) {
ok( true );
event.preventDefault();
});
- ac.one( "accordionactivate", function() {
+ element.one( "accordionactivate", function() {
ok( false );
});
- ac.accordion( "option", "active", 1 );
+ element.accordion( "option", "active", 1 );
});
}( jQuery ) );
View
26 tests/unit/accordion/accordion_methods.js
@@ -9,29 +9,29 @@ test( "destroy", function() {
});
test( "enable/disable", function() {
- var accordion = $('#list1').accordion();
- state( accordion, 1, 0, 0 );
- accordion.accordion( "disable" );
- accordion.accordion( "option", "active", 1 );
- state( accordion, 1, 0, 0 );
- accordion.accordion( "enable" );
- accordion.accordion( "option", "active", 1 );
- state( accordion, 0, 1, 0 );
+ var element = $('#list1').accordion();
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "disable" );
+ element.accordion( "option", "active", 1 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "enable" );
+ element.accordion( "option", "active", 1 );
+ accordion_state( element, 0, 1, 0 );
});
test( "refresh", function() {
- var expected = $( "#navigation" )
+ var element = $( "#navigation" )
.parent()
.height( 300 )
.end()
.accordion({
heightStyle: "fill"
});
- equalHeights( expected, 246, 258 );
+ equalHeights( element, 246, 258 );
- expected.parent().height( 500 );
- expected.accordion( "refresh" );
- equalHeights( expected, 446, 458 );
+ element.parent().height( 500 );
+ element.accordion( "refresh" );
+ equalHeights( element, 446, 458 );
});
}( jQuery ) );
View
222 tests/unit/accordion/accordion_options.js
@@ -3,184 +3,184 @@
module( "accordion: options", accordionSetupTeardown() );
test( "{ active: default }", function() {
- var ac = $( "#list1" ).accordion();
- equals( ac.accordion( "option", "active" ), 0 );
- state( ac, 1, 0, 0 );
+ var element = $( "#list1" ).accordion();
+ equals( element.accordion( "option", "active" ), 0 );
+ accordion_state( element, 1, 0, 0 );
});
test( "{ active: false }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: false,
collapsible: true
});
- state( ac, 0, 0, 0 );
- equals( ac.find( ".ui-accordion-header.ui-state-active" ).size(), 0, "no headers selected" );
- equals( ac.accordion( "option", "active" ), false );
+ accordion_state( element, 0, 0, 0 );
+ equals( element.find( ".ui-accordion-header.ui-state-active" ).size(), 0, "no headers selected" );
+ equals( element.accordion( "option", "active" ), false );
- ac.accordion( "option", "collapsible", false );
- state( ac, 1, 0, 0 );
- equals( ac.accordion( "option", "active" ), 0 );
+ element.accordion( "option", "collapsible", false );
+ accordion_state( element, 1, 0, 0 );
+ equals( element.accordion( "option", "active" ), 0 );
- ac.accordion( "destroy" );
- ac.accordion({
+ element.accordion( "destroy" );
+ element.accordion({
active: false
});
- state( ac, 1, 0, 0 );
- strictEqual( ac.accordion( "option", "active" ), 0 );
+ accordion_state( element, 1, 0, 0 );
+ strictEqual( element.accordion( "option", "active" ), 0 );
});
test( "{ active: Number }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: 2
});
- equals( ac.accordion( "option", "active" ), 2 );
- state( ac, 0, 0, 1 );
+ equals( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
- ac.accordion( "option", "active", 0 );
- equals( ac.accordion( "option", "active" ), 0 );
- state( ac, 1, 0, 0 );
+ element.accordion( "option", "active", 0 );
+ equals( element.accordion( "option", "active" ), 0 );
+ accordion_state( element, 1, 0, 0 );
- ac.find( ".ui-accordion-header" ).eq( 1 ).click();
- equals( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.find( ".ui-accordion-header" ).eq( 1 ).click();
+ equals( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
- ac.accordion( "option", "active", 10 );
- equals( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.accordion( "option", "active", 10 );
+ equals( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
});
if ( $.uiBackCompat === false ) {
test( "{ active: -Number }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: -1
});
- equals( ac.accordion( "option", "active" ), 2 );
- state( ac, 0, 0, 1 );
+ equals( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
- ac.accordion( "option", "active", -2 );
- equals( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.accordion( "option", "active", -2 );
+ equals( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
- ac.accordion( "option", "active", -10 );
- equals( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.accordion( "option", "active", -10 );
+ equals( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
- ac.accordion( "option", "active", -3 );
- equals( ac.accordion( "option", "active" ), 0 );
- state( ac, 1, 0, 0 );
+ element.accordion( "option", "active", -3 );
+ equals( element.accordion( "option", "active" ), 0 );
+ accordion_state( element, 1, 0, 0 );
});
}
// TODO: add animation tests
test( "{ collapsible: false }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: 1
});
- ac.accordion( "option", "active", false );
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.accordion( "option", "active", false );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
- ac.find( ".ui-accordion-header" ).eq( 1 ).click();
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.find( ".ui-accordion-header" ).eq( 1 ).click();
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
});
test( "{ collapsible: true }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
active: 1,
collapsible: true
});
- ac.accordion( "option", "active", false );
- equal( ac.accordion( "option", "active" ), false );
- state( ac, 0, 0, 0 );
+ element.accordion( "option", "active", false );
+ equal( element.accordion( "option", "active" ), false );
+ accordion_state( element, 0, 0, 0 );
- ac.accordion( "option", "active", 1 );
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.accordion( "option", "active", 1 );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
- ac.find( ".ui-accordion-header" ).eq( 1 ).click();
- equals( ac.accordion( "option", "active" ), false );
- state( ac, 0, 0, 0 );
+ element.find( ".ui-accordion-header" ).eq( 1 ).click();
+ equals( element.accordion( "option", "active" ), false );
+ accordion_state( element, 0, 0, 0 );
});
test( "{ event: null }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
event: null
});
- state( ac, 1, 0, 0 );
+ accordion_state( element, 1, 0, 0 );
- ac.accordion( "option", "active", 1 );
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.accordion( "option", "active", 1 );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
// ensure default click handler isn't bound
- ac.find( ".ui-accordion-header" ).eq( 2 ).click();
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.find( ".ui-accordion-header" ).eq( 2 ).click();
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
});
test( "{ event: custom }", function() {
- var ac = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
event: "custom1 custom2"
});
- state( ac, 1, 0, 0 );
+ accordion_state( element, 1, 0, 0 );
- ac.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
// ensure default click handler isn't bound
- ac.find( ".ui-accordion-header" ).eq( 2 ).trigger( "click" );
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.find( ".ui-accordion-header" ).eq( 2 ).trigger( "click" );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
- ac.find( ".ui-accordion-header" ).eq( 2 ).trigger( "custom2" );
- equal( ac.accordion( "option", "active" ), 2 );
- state( ac, 0, 0, 1 );
+ element.find( ".ui-accordion-header" ).eq( 2 ).trigger( "custom2" );
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
- ac.accordion( "option", "event", "custom3" );
+ element.accordion( "option", "event", "custom3" );
// ensure old event handlers are unbound
- ac.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
- equal( ac.accordion( "option", "active" ), 2 );
- state( ac, 0, 0, 1 );
+ element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom1" );
+ equal( element.accordion( "option", "active" ), 2 );
+ accordion_state( element, 0, 0, 1 );
- ac.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom3" );
- equal( ac.accordion( "option", "active" ), 1 );
- state( ac, 0, 1, 0 );
+ element.find( ".ui-accordion-header" ).eq( 1 ).trigger( "custom3" );
+ equal( element.accordion( "option", "active" ), 1 );
+ accordion_state( element, 0, 1, 0 );
});
test( "{ header: default }", function() {
// default: > li > :first-child,> :not(li):even
// > :not(li):even
- state( $( "#list1" ).accordion(), 1, 0, 0);
+ accordion_state( $( "#list1" ).accordion(), 1, 0, 0);
// > li > :first-child
- state( $( "#navigation" ).accordion(), 1, 0, 0);
+ accordion_state( $( "#navigation" ).accordion(), 1, 0, 0);
});
test( "{ header: custom }", function() {
- var ac = $( "#navigationWrapper" ).accordion({
+ var element = $( "#navigationWrapper" ).accordion({
header: "h2"
});
- ac.find( "h2" ).each(function() {
+ element.find( "h2" ).each(function() {
ok( $( this ).hasClass( "ui-accordion-header" ) );
});
- equal( ac.find( ".ui-accordion-header" ).length, 3 );
- state( ac, 1, 0, 0 );
- ac.accordion( "option", "active", 2 );
- state( ac, 0, 0, 1 );
+ equal( element.find( ".ui-accordion-header" ).length, 3 );
+ accordion_state( element, 1, 0, 0 );
+ element.accordion( "option", "active", 2 );
+ accordion_state( element, 0, 0, 1 );
});
test( "{ heightStyle: 'auto' }", function() {
- var ac = $( "#navigation" ).accordion({ heightStyle: "auto" });
- equalHeights( ac, 95, 130 );
+ var element = $( "#navigation" ).accordion({ heightStyle: "auto" });
+ equalHeights( element, 95, 130 );
});
test( "{ heightStyle: 'content' }", function() {
- var ac = $( "#navigation" ).accordion({ heightStyle: "content" });
- var sizes = ac.find( ".ui-accordion-content" ).map(function() {
+ var element = $( "#navigation" ).accordion({ heightStyle: "content" });
+ var sizes = element.find( ".ui-accordion-content" ).map(function() {
return $( this ).height();
}).get();
ok( sizes[ 0 ] >= 70 && sizes[ 0 ] <= 105, "was " + sizes[ 0 ] );
@@ -190,8 +190,8 @@ test( "{ heightStyle: 'content' }", function() {
test( "{ heightStyle: 'fill' }", function() {
$( "#navigationWrapper" ).height( 500 );
- var ac = $( "#navigation" ).accordion({ heightStyle: "fill" });
- equalHeights( ac, 446, 458 );
+ var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
+ equalHeights( element, 446, 458 );
});
test( "{ heightStyle: 'fill' } with sibling", function() {
@@ -203,8 +203,8 @@ test( "{ heightStyle: 'fill' } with sibling", function() {
marginBottom: 30
})
.prependTo( "#navigationWrapper" );
- var ac = $( "#navigation" ).accordion({ heightStyle: "fill" });
- equalHeights( ac , 346, 358);
+ var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
+ equalHeights( element , 346, 358);
});
test( "{ heightStyle: 'fill' } with multiple siblings", function() {
@@ -231,36 +231,36 @@ test( "{ heightStyle: 'fill' } with multiple siblings", function() {
marginBottom: 15
})
.prependTo( "#navigationWrapper" );
- var ac = $( "#navigation" ).accordion({ heightStyle: "fill" });
- equalHeights( ac, 296, 308 );
+ var element = $( "#navigation" ).accordion({ heightStyle: "fill" });
+ equalHeights( element, 296, 308 );
});
test( "{ icons: false }", function() {
- var list = $( "#list1" );
+ var element = $( "#list1" );
function icons( on ) {
- same( list.find( "span.ui-icon").length, on ? 3 : 0 );
- same( list.hasClass( "ui-accordion-icons" ), on );
+ same( element.find( "span.ui-icon").length, on ? 3 : 0 );
+ same( element.hasClass( "ui-accordion-icons" ), on );
}
- list.accordion();
+ element.accordion();
icons( true );
- list.accordion( "destroy" ).accordion({
+ element.accordion( "destroy" ).accordion({
icons: false
});
icons( false );
- list.accordion( "option", "icons", { header: "foo", activeHeader: "bar" } );
+ element.accordion( "option", "icons", { header: "foo", activeHeader: "bar" } );
icons( true );
- list.accordion( "option", "icons", false );
+ element.accordion( "option", "icons", false );
icons( false );
});
test( "{ icons: hash }", function() {
- var list = $( "#list1" ).accordion({
+ var element = $( "#list1" ).accordion({
icons: { activeHeader: "a1", header: "h1" }
});
- ok( list.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
- list.accordion( "option", "icons", { activeHeader: "a2", header: "h2" } );
- ok( !list.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
- ok( list.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) );
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ element.accordion( "option", "icons", { activeHeader: "a2", header: "h2" } );
+ ok( !element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a1" ) );
+ ok( element.find( ".ui-accordion-header.ui-state-active span.ui-icon" ).hasClass( "a2" ) );
});
}( jQuery ) );
View
42 tests/unit/autocomplete/autocomplete_defaults.js
@@ -1,19 +1,25 @@
-/*
- * autocomplete_defaults.js
- */
+commonWidgetTests( "autocomplete", {
+ defaults: {
+ appendTo: "body",
+ autoFocus: false,
+ delay: 300,
+ disabled: false,
+ minLength: 1,
+ position: {
+ my: "left top",
+ at: "left bottom",
+ collision: "none"
+ },
+ source: null,
-var autocomplete_defaults = {
- appendTo: "body",
- autoFocus: false,
- delay: 300,
- disabled: false,
- minLength: 1,
- position: {
- my: "left top",
- at: "left bottom",
- collision: "none"
- },
- source: null
-};
-
-commonWidgetTests('autocomplete', { defaults: autocomplete_defaults });
+ // callbacks
+ change: null,
+ close: null,
+ create: null,
+ focus: null,
+ open: null,
+ response: null,
+ search: null,
+ select: null
+ }
+});
View
25 tests/unit/button/button_defaults.js
@@ -1,15 +1,14 @@
-/*
- * button_defaults.js
- */
+commonWidgetTests( "button", {
+ defaults: {
+ disabled: null,
+ icons: {
+ primary: null,
+ secondary: null
+ },
+ label: null,
+ text: true,
-var button_defaults = {
- disabled: null,
- text: true,
- label: null,
- icons: {
- primary: null,
- secondary: null
+ // callbacks
+ create: null
}
-};
-
-commonWidgetTests('button', { defaults: button_defaults });
+});
View
67 tests/unit/dialog/dialog_defaults.js
@@ -1,35 +1,34 @@
-/*
- * dialog_defaults.js
- */
+commonWidgetTests( "dialog", {
+ defaults: {
+ autoOpen: true,
+ buttons: {},
+ closeOnEscape: true,
+ closeText: 'close',
+ disabled: false,
+ dialogClass: '',
+ draggable: true,
+ height: 'auto',
+ hide: null,
+ maxHeight: false,
+ maxWidth: false,
+ minHeight: 150,
+ minWidth: 150,
+ modal: false,
+ position: {
+ my: 'center',
+ at: 'center',
+ of: window,
+ collision: 'fit',
+ using: $.ui.dialog.prototype.options.position.using
+ },
+ resizable: true,
+ show: null,
+ stack: true,
+ title: '',
+ width: 300,
+ zIndex: 1000,
-var dialog_defaults = {
- autoOpen: true,
- buttons: {},
- closeOnEscape: true,
- closeText: 'close',
- disabled: false,
- dialogClass: '',
- draggable: true,
- height: 'auto',
- hide: null,
- maxHeight: false,
- maxWidth: false,
- minHeight: 150,
- minWidth: 150,
- modal: false,
- position: {
- my: 'center',
- at: 'center',
- of: window,
- collision: 'fit',
- using: $.ui.dialog.prototype.options.position.using
- },
- resizable: true,
- show: null,
- stack: true,
- title: '',
- width: 300,
- zIndex: 1000
-};
-
-commonWidgetTests('dialog', { defaults: dialog_defaults });
+ // callbacks
+ create: null
+ }
+});
View
4 tests/unit/dialog/dialog_options.js
@@ -180,7 +180,7 @@ test("height", function() {
expect(3);
el = $('<div></div>').dialog();
- equals(dlg().height(), dialog_defaults.minHeight, "default height");
+ equals(dlg().height(), 150, "default height");
el.remove();
el = $('<div></div>').dialog({ height: 237 });
@@ -431,7 +431,7 @@ test("width", function() {
expect(3);
el = $('<div></div>').dialog();
- equals(dlg().width(), dialog_defaults.width, "default width");
+ equals(dlg().width(), 300, "default width");
el.remove();
el = $('<div></div>').dialog({width: 437 });
View
21 tests/unit/menu/menu_defaults.js
@@ -1,13 +1,12 @@
-/*
- * menu_defaults.js
- */
+commonWidgetTests( "menu", {
+ defaults: {
+ disabled: false,
+ position: {
+ my: "left top",
+ at: "right top"
+ },
-var menu_defaults = {
- disabled: false,
- position: {
- my: "left top",
- at: "right top"
+ // callbacks
+ create: null
}
-};
-
-commonWidgetTests('menu', { defaults: menu_defaults });
+});
View
19 tests/unit/progressbar/progressbar_defaults.js
@@ -1,11 +1,10 @@
-/*
- * progressbar_defaults.js
- */
+commonWidgetTests( "progressbar", {
+ defaults: {
+ disabled: false,
+ value: 0,
+ max: 100,
-var progressbar_defaults = {
- disabled: false,
- value: 0,
- max: 100
-};
-
-commonWidgetTests('progressbar', { defaults: progressbar_defaults });
+ //callbacks
+ create: null
+ }
+});
View
17 tests/unit/progressbar/progressbar_options.js
@@ -10,6 +10,23 @@ test("{ value : 0 }, default", function() {
same( 0, $("#progressbar").progressbar("value") );
});
+// Ticket #7231 - valueDiv should be hidden when value is at 0%
+test( "value: visibility of valueDiv", function() {
+ expect( 5 );
+ var element = $( "#progressbar" ).progressbar({
+ value: 0
+ });
+ ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is initialized at 0" );
+ element.progressbar( "value", 1 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 1" );
+ element.progressbar( "value", 100 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":visible" ), "valueDiv visible when value is set to 100" );
+ element.progressbar( "value", 0 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value is set to 0" );
+ element.progressbar( "value", -1 );
+ ok( element.children( ".ui-progressbar-value" ).is( ":hidden" ), "valueDiv hidden when value set to -1 (normalizes to 0)" );
+});
+
test("{ value : 5 }", function() {
$("#progressbar").progressbar({
value: 5
View
37 tests/unit/slider/slider_defaults.js
@@ -1,20 +1,19 @@
-/*
- * slider_defaults.js
- */
+commonWidgetTests( "slider", {
+ defaults: {
+ animate: false,
+ cancel: function() {},
+ delay: 0,
+ disabled: false,
+ distance: 0,
+ max: 100,
+ min: 0,
+ orientation: 'horizontal',
+ range: false,
+ step: 1,
+ value: 0,
+ values: null,
-var slider_defaults = {