Merge remote branch 'origin/master'
@ -11,7 +11,7 @@
|
|||||||
.toggler { width: 500px; height: 200px; position: relative;}
|
.toggler { width: 500px; height: 200px; position: relative;}
|
||||||
#button { padding: .5em 1em; text-decoration: none; }
|
#button { padding: .5em 1em; text-decoration: none; }
|
||||||
#effect { width: 240px; padding: 1em; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
|
#effect { width: 240px; padding: 1em; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
|
||||||
#effect.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
@ -54,6 +54,12 @@
|
|||||||
minLength: 0
|
minLength: 0
|
||||||
})
|
})
|
||||||
.addClass("ui-widget ui-widget-content ui-corner-left");
|
.addClass("ui-widget ui-widget-content ui-corner-left");
|
||||||
|
input.data("autocomplete")._renderItem = function( ul, item) {
|
||||||
|
return $( "<li></li>" )
|
||||||
|
.data( "item.autocomplete", item )
|
||||||
|
.append( "<a>" + item.label + "</a>" )
|
||||||
|
.appendTo( ul );
|
||||||
|
};
|
||||||
$("<button> </button>")
|
$("<button> </button>")
|
||||||
.attr("tabIndex", -1)
|
.attr("tabIndex", -1)
|
||||||
.attr("title", "Show All Items")
|
.attr("title", "Show All Items")
|
||||||
@ -96,19 +102,28 @@
|
|||||||
<label>Your preferred programming language: </label>
|
<label>Your preferred programming language: </label>
|
||||||
<select id="combobox">
|
<select id="combobox">
|
||||||
<option value="">Select one...</option>
|
<option value="">Select one...</option>
|
||||||
<option value="a">asp</option>
|
<option value="ActionScript">ActionScript</option>
|
||||||
<option value="c">c</option>
|
<option value="AppleScript">AppleScript</option>
|
||||||
<option value="cpp">c++</option>
|
<option value="Asp">Asp</option>
|
||||||
<option value="cf">coldfusion</option>
|
<option value="BASIC">BASIC</option>
|
||||||
<option value="g">groovy</option>
|
<option value="C">C</option>
|
||||||
<option value="h">haskell</option>
|
<option value="C++">C++</option>
|
||||||
<option value="j">java</option>
|
<option value="Clojure">Clojure</option>
|
||||||
<option value="js">javascript</option>
|
<option value="COBOL">COBOL</option>
|
||||||
<option value="p1">perl</option>
|
<option value="ColdFusion">ColdFusion</option>
|
||||||
<option value="p2">php</option>
|
<option value="Erlang">Erlang</option>
|
||||||
<option value="p3">python</option>
|
<option value="Fortran">Fortran</option>
|
||||||
<option value="r">ruby</option>
|
<option value="Groovy">Groovy</option>
|
||||||
<option value="s">scala</option>
|
<option value="Haskell">Haskell</option>
|
||||||
|
<option value="Java">Java</option>
|
||||||
|
<option value="JavaScript">JavaScript</option>
|
||||||
|
<option value="Lisp">Lisp</option>
|
||||||
|
<option value="Perl">Perl</option>
|
||||||
|
<option value="PHP">PHP</option>
|
||||||
|
<option value="Python">Python</option>
|
||||||
|
<option value="Ruby">Ruby</option>
|
||||||
|
<option value="Scala">Scala</option>
|
||||||
|
<option value="Scheme">Scheme</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<button id="toggle">Show underlying select</button>
|
<button id="toggle">Show underlying select</button>
|
||||||
|
@ -60,7 +60,7 @@
|
|||||||
$('#project').val(ui.item.label);
|
$('#project').val(ui.item.label);
|
||||||
$('#project-id').val(ui.item.value);
|
$('#project-id').val(ui.item.value);
|
||||||
$('#project-description').html(ui.item.desc);
|
$('#project-description').html(ui.item.desc);
|
||||||
$('#project-icon').attr('src', '../images/' + ui.item.icon);
|
$('#project-icon').attr('src', 'images/' + ui.item.icon);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -78,7 +78,7 @@
|
|||||||
|
|
||||||
<div class="demo">
|
<div class="demo">
|
||||||
<div id="project-label">Select a project (type "j" for a start):</div>
|
<div id="project-label">Select a project (type "j" for a start):</div>
|
||||||
<img id="project-icon" src="../images/transparent_1x1.png" class="ui-state-default"/>
|
<img id="project-icon" src="images/transparent_1x1.png" class="ui-state-default"/>
|
||||||
<input id="project"/>
|
<input id="project"/>
|
||||||
<input type="hidden" id="project-id"/>
|
<input type="hidden" id="project-id"/>
|
||||||
<p id="project-description"></p>
|
<p id="project-description"></p>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
|
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
|
||||||
$("#tags").autocomplete({
|
$("#tags").autocomplete({
|
||||||
source: availableTags
|
source: availableTags
|
||||||
});
|
});
|
||||||
|
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.9 KiB |
Before Width: | Height: | Size: 3.7 KiB After Width: | Height: | Size: 3.7 KiB |
Before Width: | Height: | Size: 137 B After Width: | Height: | Size: 137 B |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
@ -13,10 +13,12 @@
|
|||||||
<li><a href="remote.html">Remote datasource</a></li>
|
<li><a href="remote.html">Remote datasource</a></li>
|
||||||
<li><a href="remote-with-cache.html">Remote with caching</a></li>
|
<li><a href="remote-with-cache.html">Remote with caching</a></li>
|
||||||
<li><a href="remote-jsonp.html">Remote JSONP datasource</a></li>
|
<li><a href="remote-jsonp.html">Remote JSONP datasource</a></li>
|
||||||
|
<li><a href="maxheight.html">Scrollable results</a></li>
|
||||||
<li><a href="combobox.html">Combobox</a></li>
|
<li><a href="combobox.html">Combobox</a></li>
|
||||||
<li><a href="custom-data.html">Custom data and display</a></li>
|
<li><a href="custom-data.html">Custom data and display</a></li>
|
||||||
<li><a href="xml.html">XML data parsed once</a></li>
|
<li><a href="xml.html">XML data parsed once</a></li>
|
||||||
<li><a href="categories.html">Categories</a></li>
|
<li><a href="categories.html">Categories</a></li>
|
||||||
|
<li><a href="folding.html">Accent folding</a></li>
|
||||||
<li><a href="multiple.html">Multiple values</a></li>
|
<li><a href="multiple.html">Multiple values</a></li>
|
||||||
<li><a href="multiple-remote.html">Multiple, remote</a></li>
|
<li><a href="multiple-remote.html">Multiple, remote</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
52
demos/autocomplete/maxheight.html
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8" />
|
||||||
|
<title>jQuery UI Autocomplete Scrollable Results Demo</title>
|
||||||
|
<link type="text/css" href="../../themes/base/jquery.ui.all.css" rel="stylesheet" />
|
||||||
|
<script type="text/javascript" src="../../jquery-1.4.2.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/jquery.ui.core.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/jquery.ui.widget.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
||||||
|
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
||||||
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<style type="text/css">
|
||||||
|
.ui-autocomplete {
|
||||||
|
max-height: 100px;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
/* IE 6 doesn't support max-height
|
||||||
|
* we use height instead, but this forces the menu to always be this tall
|
||||||
|
*/
|
||||||
|
* html .ui-autocomplete {
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
$(function() {
|
||||||
|
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
|
||||||
|
$("#tags").autocomplete({
|
||||||
|
source: availableTags
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
|
||||||
|
<div class="demo">
|
||||||
|
|
||||||
|
<div class="ui-widget">
|
||||||
|
<label for="tags">Tags: </label>
|
||||||
|
<input id="tags" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div><!-- End demo -->
|
||||||
|
|
||||||
|
<div class="demo-description">
|
||||||
|
<p>
|
||||||
|
When displaying a long list of options, you can simply set the max-height for the autocomplete menu to prevent the menu from growing too large. Try typing "a" or "s" above to get a long list of results that you can scroll through.
|
||||||
|
</p>
|
||||||
|
</div><!-- End demo-description -->
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -10,6 +10,9 @@
|
|||||||
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
||||||
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<style type="text/css">
|
||||||
|
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
|
||||||
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
function split(val) {
|
function split(val) {
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
var availableTags = ["c++", "java", "php", "coldfusion", "javascript", "asp", "ruby", "python", "c", "scala", "groovy", "haskell", "perl"];
|
var availableTags = ["ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", "Clojure", "COBOL", "ColdFusion", "Erlang", "Fortran", "Groovy", "Haskell", "Java", "JavaScript", "Lisp", "Perl", "PHP", "Python", "Ruby", "Scala", "Scheme"];
|
||||||
function split(val) {
|
function split(val) {
|
||||||
return val.split(/,\s*/);
|
return val.split(/,\s*/);
|
||||||
}
|
}
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
||||||
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<style type="text/css">
|
||||||
|
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
|
||||||
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
function log(message) {
|
function log(message) {
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
||||||
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<style type="text/css">
|
||||||
|
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
|
||||||
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
var cache = {};
|
var cache = {};
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
||||||
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<style type="text/css">
|
||||||
|
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
|
||||||
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
function log(message) {
|
function log(message) {
|
||||||
|
@ -3,8 +3,8 @@
|
|||||||
$q = strtolower($_GET["term"]);
|
$q = strtolower($_GET["term"]);
|
||||||
if (!$q) return;
|
if (!$q) return;
|
||||||
$items = array(
|
$items = array(
|
||||||
"Great <em>Bittern</em>"=>"Botaurus stellaris",
|
"Great Bittern"=>"Botaurus stellaris",
|
||||||
"Little <em>Grebe</em>"=>"Tachybaptus ruficollis",
|
"Little Grebe"=>"Tachybaptus ruficollis",
|
||||||
"Black-necked Grebe"=>"Podiceps nigricollis",
|
"Black-necked Grebe"=>"Podiceps nigricollis",
|
||||||
"Little Bittern"=>"Ixobrychus minutus",
|
"Little Bittern"=>"Ixobrychus minutus",
|
||||||
"Black-crowned Night Heron"=>"Nycticorax nycticorax",
|
"Black-crowned Night Heron"=>"Nycticorax nycticorax",
|
||||||
|
@ -10,6 +10,9 @@
|
|||||||
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.position.js"></script>
|
||||||
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
<script type="text/javascript" src="../../ui/jquery.ui.autocomplete.js"></script>
|
||||||
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
<link type="text/css" href="../demos.css" rel="stylesheet" />
|
||||||
|
<style type="text/css">
|
||||||
|
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
|
||||||
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
function log(message) {
|
function log(message) {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
.toggler { width: 500px; height: 200px; position: relative;}
|
.toggler { width: 500px; height: 200px; position: relative;}
|
||||||
#button { padding: .5em 1em; text-decoration: none; }
|
#button { padding: .5em 1em; text-decoration: none; }
|
||||||
#effect {position: relative; width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
|
#effect {position: relative; width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
|
||||||
#effect.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
@ -11,8 +11,8 @@
|
|||||||
.toggler { width: 500px; height: 200px; position: relative;}
|
.toggler { width: 500px; height: 200px; position: relative;}
|
||||||
#button { padding: .5em 1em; text-decoration: none; }
|
#button { padding: .5em 1em; text-decoration: none; }
|
||||||
#effect {position: relative; }
|
#effect {position: relative; }
|
||||||
#effect.newClass { width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; }
|
.newClass { width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; margin: 0; }
|
||||||
#effect.anotherNewClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
.anotherNewClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
.toggler { width: 500px; height: 200px; position: relative;}
|
.toggler { width: 500px; height: 200px; position: relative;}
|
||||||
#button { padding: .5em 1em; text-decoration: none; }
|
#button { padding: .5em 1em; text-decoration: none; }
|
||||||
#effect {position: relative; width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
|
#effect {position: relative; width: 240px; padding: 1em; letter-spacing: 0; font-size: 1.2em; border: 1px solid #000; background: #eee; color: #333; }
|
||||||
#effect.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
.newClass { text-indent: 40px; letter-spacing: .4em; width: 410px; height: 100px; padding: 30px; margin: 10px; font-size: 1.6em; }
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
@ -6,7 +6,12 @@ var autocomplete_defaults = {
|
|||||||
delay: 300,
|
delay: 300,
|
||||||
disabled: false,
|
disabled: false,
|
||||||
minLength: 1,
|
minLength: 1,
|
||||||
source: undefined
|
position: {
|
||||||
|
my: "left top",
|
||||||
|
at: "left bottom",
|
||||||
|
collision: "none"
|
||||||
|
},
|
||||||
|
source: null
|
||||||
};
|
};
|
||||||
|
|
||||||
commonWidgetTests('autocomplete', { defaults: autocomplete_defaults });
|
commonWidgetTests('autocomplete', { defaults: autocomplete_defaults });
|
||||||
|
@ -242,8 +242,8 @@ test("modal", function() {
|
|||||||
|
|
||||||
test("position, default center on window", function() {
|
test("position, default center on window", function() {
|
||||||
var el = $('<div></div>').dialog();
|
var el = $('<div></div>').dialog();
|
||||||
var offset = el.parent().offset();
|
var dialog = el.dialog('widget');
|
||||||
// use .position() instead to avoid replicating center-logic?
|
var offset = dialog.offset();
|
||||||
same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
|
same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
|
||||||
same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
|
same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
|
||||||
el.remove();
|
el.remove();
|
||||||
@ -251,16 +251,16 @@ test("position, default center on window", function() {
|
|||||||
|
|
||||||
test("position, top on window", function() {
|
test("position, top on window", function() {
|
||||||
var el = $('<div></div>').dialog({ position: "top" });
|
var el = $('<div></div>').dialog({ position: "top" });
|
||||||
var dialog = el.closest('.ui-dialog');
|
var dialog = el.dialog('widget');
|
||||||
var offset = dialog.offset();
|
var offset = dialog.offset();
|
||||||
same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2));
|
same(offset.left, Math.floor($(window).width() / 2 - dialog.outerWidth() / 2) + $(window).scrollLeft());
|
||||||
same(offset.top, $(window).scrollTop());
|
same(offset.top, $(window).scrollTop());
|
||||||
el.remove();
|
el.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("position, left on window", function() {
|
test("position, left on window", function() {
|
||||||
var el = $('<div></div>').dialog({ position: "left" });
|
var el = $('<div></div>').dialog({ position: "left" });
|
||||||
var dialog = el.closest('.ui-dialog');
|
var dialog = el.dialog('widget');
|
||||||
var offset = dialog.offset();
|
var offset = dialog.offset();
|
||||||
same(offset.left, 0);
|
same(offset.left, 0);
|
||||||
same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
|
same(offset.top, Math.floor($(window).height() / 2 - dialog.outerHeight() / 2) + $(window).scrollTop());
|
||||||
@ -269,27 +269,27 @@ test("position, left on window", function() {
|
|||||||
|
|
||||||
test("position, right bottom on window", function() {
|
test("position, right bottom on window", function() {
|
||||||
var el = $('<div></div>').dialog({ position: "right bottom" });
|
var el = $('<div></div>').dialog({ position: "right bottom" });
|
||||||
var dialog = el.closest('.ui-dialog');
|
var dialog = el.dialog('widget');
|
||||||
var offset = dialog.offset();
|
var offset = dialog.offset();
|
||||||
same(offset.left, $(window).width() - dialog.outerWidth());
|
same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
|
||||||
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
|
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
|
||||||
el.remove();
|
el.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("position, right bottom on window w/array", function() {
|
test("position, right bottom on window w/array", function() {
|
||||||
var el = $('<div></div>').dialog({ position: ["right", "bottom"] });
|
var el = $('<div></div>').dialog({ position: ["right", "bottom"] });
|
||||||
var dialog = el.closest('.ui-dialog');
|
var dialog = el.dialog('widget');
|
||||||
var offset = dialog.offset();
|
var offset = dialog.offset();
|
||||||
same(offset.left, $(window).width() - dialog.outerWidth());
|
same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
|
||||||
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
|
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
|
||||||
el.remove();
|
el.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
test("position, offset from top left w/array", function() {
|
test("position, offset from top left w/array", function() {
|
||||||
var el = $('<div></div>').dialog({ position: [10, 10] });
|
var el = $('<div></div>').dialog({ position: [10, 10] });
|
||||||
var dialog = el.closest('.ui-dialog');
|
var dialog = el.dialog('widget');
|
||||||
var offset = dialog.offset();
|
var offset = dialog.offset();
|
||||||
same(offset.left, 10);
|
same(offset.left, 10 + $(window).scrollLeft());
|
||||||
same(offset.top, 10 + $(window).scrollTop());
|
same(offset.top, 10 + $(window).scrollTop());
|
||||||
el.remove();
|
el.remove();
|
||||||
});
|
});
|
||||||
@ -302,10 +302,10 @@ test("position, right bottom at right bottom via ui.position args", function() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var dialog = el.closest('.ui-dialog');
|
var dialog = el.dialog('widget');
|
||||||
var offset = dialog.offset();
|
var offset = dialog.offset();
|
||||||
|
|
||||||
same(offset.left, $(window).width() - dialog.outerWidth());
|
same(offset.left, $(window).width() - dialog.outerWidth() + $(window).scrollLeft());
|
||||||
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
|
same(offset.top, $(window).height() - dialog.outerHeight() + $(window).scrollTop());
|
||||||
el.remove();
|
el.remove();
|
||||||
});
|
});
|
||||||
@ -317,22 +317,21 @@ test("position, at another element", function() {
|
|||||||
left: 600,
|
left: 600,
|
||||||
height: 10,
|
height: 10,
|
||||||
width: 10
|
width: 10
|
||||||
});
|
}).appendTo('body');
|
||||||
|
|
||||||
var el = $('<div></div>').dialog({
|
var el = $('<div></div>').dialog({
|
||||||
position: {
|
position: {
|
||||||
my: "left top",
|
my: "left top",
|
||||||
at: "top left",
|
at: "left top",
|
||||||
of: parent
|
of: parent
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var dialog = el.closest('.ui-dialog');
|
var dialog = el.dialog('widget');
|
||||||
var offset = dialog.offset();
|
var offset = dialog.offset();
|
||||||
var parentOffset = parent.offset();
|
|
||||||
|
|
||||||
same(offset.left, parentOffset.left);
|
same(offset.left, 600);
|
||||||
same(offset.top, parentOffset.top);
|
same(offset.top, 400);
|
||||||
|
|
||||||
el.dialog('option', 'position', {
|
el.dialog('option', 'position', {
|
||||||
my: "left top",
|
my: "left top",
|
||||||
@ -340,18 +339,15 @@ test("position, at another element", function() {
|
|||||||
of: parent
|
of: parent
|
||||||
});
|
});
|
||||||
|
|
||||||
same(offset.left, parentOffset.left + parent.outerWidth());
|
var offset = dialog.offset();
|
||||||
same(offset.top, parentOffset.top + parent.outerHeight());
|
|
||||||
|
same(offset.left, 610);
|
||||||
|
same(offset.top, 410);
|
||||||
|
|
||||||
el.remove();
|
el.remove();
|
||||||
parent.remove();
|
parent.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
test("position, others", function() {
|
|
||||||
ok(false, 'missing test - untested code is broken code');
|
|
||||||
});
|
|
||||||
|
|
||||||
test("resizable", function() {
|
test("resizable", function() {
|
||||||
expect(4);
|
expect(4);
|
||||||
|
|
||||||
|
@ -202,6 +202,10 @@ test("{ containment: Selector }", function() {
|
|||||||
ok(false, 'missing test - untested code is broken code');
|
ok(false, 'missing test - untested code is broken code');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("{ containment: [x1, y1, x2, y2] }", function() {
|
||||||
|
ok(false, 'missing test - untested code is broken code');
|
||||||
|
});
|
||||||
|
|
||||||
test("{ cursor: 'auto' }, default", function() {
|
test("{ cursor: 'auto' }, default", function() {
|
||||||
equals(draggable_defaults.cursor, 'auto');
|
equals(draggable_defaults.cursor, 'auto');
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
<link rel="stylesheet" href="../../../external/qunit.css" type="text/css"/>
|
||||||
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
<script type="text/javascript" src="../../../external/qunit.js"></script>
|
||||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||||
|
<script type="text/javascript" src="../testsuite.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="tabs_core.js"></script>
|
<script type="text/javascript" src="tabs_core.js"></script>
|
||||||
<script type="text/javascript" src="tabs_defaults.js"></script>
|
<script type="text/javascript" src="tabs_defaults.js"></script>
|
||||||
|
@ -97,7 +97,7 @@ test('remove', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test('select', function() {
|
test('select', function() {
|
||||||
expect(9);
|
expect(6);
|
||||||
|
|
||||||
el = $('#tabs1').tabs();
|
el = $('#tabs1').tabs();
|
||||||
|
|
||||||
@ -114,21 +114,12 @@ test('select', function() {
|
|||||||
el.tabs('select', -1);
|
el.tabs('select', -1);
|
||||||
equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in -1');
|
equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in -1');
|
||||||
|
|
||||||
el.tabs('destroy');
|
|
||||||
el.tabs({ collapsible: true });
|
|
||||||
el.tabs('select', null);
|
|
||||||
equals(el.tabs('option', 'selected'), -1, 'should collapse tab passing in null (deprecated)');
|
|
||||||
el.tabs('select', null);
|
|
||||||
equals(el.tabs('option', 'selected'), -1, 'should not select tab passing in null a second time (deprecated)');
|
|
||||||
|
|
||||||
el.tabs('destroy');
|
el.tabs('destroy');
|
||||||
el.tabs();
|
el.tabs();
|
||||||
el.tabs('select', 0);
|
el.tabs('select', 0);
|
||||||
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true');
|
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true');
|
||||||
el.tabs('select', -1);
|
el.tabs('select', -1);
|
||||||
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true');
|
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true');
|
||||||
el.tabs('select', null);
|
|
||||||
equals(el.tabs('option', 'selected'), 0, 'should not collapse tab if collapsible is not set to true');
|
|
||||||
|
|
||||||
el.tabs('select', '#fragment-2');
|
el.tabs('select', '#fragment-2');
|
||||||
equals(el.tabs('option', 'selected'), 1, 'should select tab by id');
|
equals(el.tabs('option', 'selected'), 1, 'should select tab by id');
|
||||||
|
@ -13,7 +13,8 @@
|
|||||||
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
<script type="text/javascript" src="../../jquery.simulate.js"></script>
|
||||||
<script type="text/javascript" src="../testsuite.js"></script>
|
<script type="text/javascript" src="../testsuite.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="widget.js"></script>
|
<script type="text/javascript" src="widget_core.js"></script>
|
||||||
|
<script type="text/javascript" src="widget_tickets.js"></script>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
46
tests/unit/widget/widget_tickets.js
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*
|
||||||
|
* widget unit tests
|
||||||
|
*/
|
||||||
|
(function($) {
|
||||||
|
|
||||||
|
module('widget: tickets');
|
||||||
|
|
||||||
|
test('#5830 - Widget: Using inheritance overwrites the base classes options', function() {
|
||||||
|
$.widget( "ui.testWidgetBase", {
|
||||||
|
options: {
|
||||||
|
obj: {
|
||||||
|
key1: "foo",
|
||||||
|
key2: "bar"
|
||||||
|
},
|
||||||
|
arr: [ "testing" ]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$.widget( "ui.testWidgetExtension", $.ui.testWidgetBase, {
|
||||||
|
options: {
|
||||||
|
obj: {
|
||||||
|
key1: "baz"
|
||||||
|
},
|
||||||
|
arr: [ "alpha", "beta" ]
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
same( $.ui.testWidgetBase.prototype.options.obj, {
|
||||||
|
key1: "foo",
|
||||||
|
key2: "bar"
|
||||||
|
}, "base class option object not overridden");
|
||||||
|
same( $.ui.testWidgetBase.prototype.options.arr, [ "testing" ],
|
||||||
|
"base class option array not overridden");
|
||||||
|
|
||||||
|
same( $.ui.testWidgetExtension.prototype.options.obj, {
|
||||||
|
key1: "baz",
|
||||||
|
key2: "bar"
|
||||||
|
}, "extension class option object extends base");
|
||||||
|
same( $.ui.testWidgetExtension.prototype.options.arr, [ "alpha", "beta" ],
|
||||||
|
"extension class option array overwrites base");
|
||||||
|
|
||||||
|
delete $.ui.testWidgetBase;
|
||||||
|
delete $.ui.testWidgetExtension;
|
||||||
|
});
|
||||||
|
|
||||||
|
})(jQuery);
|
@ -16,7 +16,10 @@
|
|||||||
<script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
|
<script type="text/javascript" src="../../../ui/jquery.ui.button.js"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function() {
|
$(function() {
|
||||||
|
var start = +new Date();
|
||||||
$("button").button();
|
$("button").button();
|
||||||
|
var end = +new Date();
|
||||||
|
$("<p></p>").text( "Time to initialize: " + (end - start) + "ms" ).prependTo("body");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
@ -250,7 +250,7 @@
|
|||||||
<a href="#">Go back</a>
|
<a href="#">Go back</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="ui-widget" style="margin-top:2em; font-family:Arial">
|
<div class="ui-widget" style="clear: left; margin-top:2em; font-family:Arial">
|
||||||
Log:
|
Log:
|
||||||
<div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
|
<div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -109,7 +109,7 @@
|
|||||||
<li><a href="#">Amesville</a></li>
|
<li><a href="#">Amesville</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div class="ui-widget" style="margin-top:2em; font-family:Arial">
|
<div class="ui-widget" style="clear: left; margin-top:2em; font-family:Arial">
|
||||||
Log:
|
Log:
|
||||||
<div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
|
<div id="log" style="height: 400px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
|
||||||
</div>
|
</div>
|
||||||
|
2
themes/base/jquery.ui.autocomplete.css
vendored
@ -8,7 +8,6 @@
|
|||||||
* http://docs.jquery.com/UI/Autocomplete#theming
|
* http://docs.jquery.com/UI/Autocomplete#theming
|
||||||
*/
|
*/
|
||||||
.ui-autocomplete { position: absolute; cursor: default; }
|
.ui-autocomplete { position: absolute; cursor: default; }
|
||||||
.ui-autocomplete-loading { background: white url('images/ui-anim_basic_16x16.gif') right center no-repeat; }
|
|
||||||
|
|
||||||
/* workarounds */
|
/* workarounds */
|
||||||
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
|
||||||
@ -27,6 +26,7 @@
|
|||||||
padding: 2px;
|
padding: 2px;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
display:block;
|
display:block;
|
||||||
|
float: left;
|
||||||
}
|
}
|
||||||
.ui-menu .ui-menu {
|
.ui-menu .ui-menu {
|
||||||
margin-top: -3px;
|
margin-top: -3px;
|
||||||
|
2
themes/base/jquery.ui.dialog.css
vendored
@ -15,6 +15,6 @@
|
|||||||
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
|
||||||
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; }
|
||||||
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; }
|
||||||
.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; padding: .2em .6em .3em .6em; line-height: 1.4em; width:auto; overflow:visible; }
|
.ui-dialog .ui-dialog-buttonpane button { float: right; margin: .5em .4em .5em 0; cursor: pointer; }
|
||||||
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
|
||||||
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
.ui-draggable .ui-dialog-titlebar { cursor: move; }
|
||||||
|
6
ui/i18n/jquery.ui.datepicker-pt-BR.js
vendored
@ -10,9 +10,9 @@ jQuery(function($){
|
|||||||
'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
|
'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
|
||||||
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
|
monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
|
||||||
'Jul','Ago','Set','Out','Nov','Dez'],
|
'Jul','Ago','Set','Out','Nov','Dez'],
|
||||||
dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sabado'],
|
dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
|
||||||
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
|
dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
|
||||||
dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sab'],
|
dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
|
||||||
weekHeader: 'Sm',
|
weekHeader: 'Sm',
|
||||||
dateFormat: 'dd/mm/yy',
|
dateFormat: 'dd/mm/yy',
|
||||||
firstDay: 0,
|
firstDay: 0,
|
||||||
|
4
ui/jquery.ui.accordion.js
vendored
@ -79,7 +79,9 @@ $.widget("ui.accordion", {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.active = this._findActive(this.active || o.active).toggleClass("ui-state-default").toggleClass("ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");
|
this.active = this._findActive(this.active || o.active)
|
||||||
|
.addClass("ui-state-default ui-state-active")
|
||||||
|
.toggleClass("ui-corner-all ui-corner-top");
|
||||||
this.active.next().addClass('ui-accordion-content-active');
|
this.active.next().addClass('ui-accordion-content-active');
|
||||||
|
|
||||||
//Append icon elements
|
//Append icon elements
|
||||||
|
43
ui/jquery.ui.autocomplete.js
vendored
@ -16,8 +16,14 @@
|
|||||||
|
|
||||||
$.widget( "ui.autocomplete", {
|
$.widget( "ui.autocomplete", {
|
||||||
options: {
|
options: {
|
||||||
|
delay: 300,
|
||||||
minLength: 1,
|
minLength: 1,
|
||||||
delay: 300
|
position: {
|
||||||
|
my: "left top",
|
||||||
|
at: "left bottom",
|
||||||
|
collision: "none"
|
||||||
|
},
|
||||||
|
source: null
|
||||||
},
|
},
|
||||||
_create: function() {
|
_create: function() {
|
||||||
var self = this,
|
var self = this,
|
||||||
@ -126,9 +132,12 @@ $.widget( "ui.autocomplete", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
selected: function( event, ui ) {
|
selected: function( event, ui ) {
|
||||||
var item = ui.item.data( "item.autocomplete" );
|
var item = ui.item.data( "item.autocomplete" ),
|
||||||
|
setValue = false;
|
||||||
if ( false !== self._trigger( "select", event, { item: item } ) ) {
|
if ( false !== self._trigger( "select", event, { item: item } ) ) {
|
||||||
self.element.val( item.value );
|
// #5639 - if we set the value before setting focus
|
||||||
|
// the cursor will move to the beginning of the field in IE
|
||||||
|
setValue = true;
|
||||||
}
|
}
|
||||||
self.close( event );
|
self.close( event );
|
||||||
// only trigger when focus was lost (click on menu)
|
// only trigger when focus was lost (click on menu)
|
||||||
@ -138,6 +147,9 @@ $.widget( "ui.autocomplete", {
|
|||||||
self.previous = previous;
|
self.previous = previous;
|
||||||
}
|
}
|
||||||
self.selectedItem = item;
|
self.selectedItem = item;
|
||||||
|
if ( setValue ) {
|
||||||
|
self.element.val( item.value );
|
||||||
|
}
|
||||||
},
|
},
|
||||||
blur: function( event, ui ) {
|
blur: function( event, ui ) {
|
||||||
if ( self.menu.element.is(":visible") ) {
|
if ( self.menu.element.is(":visible") ) {
|
||||||
@ -269,16 +281,17 @@ $.widget( "ui.autocomplete", {
|
|||||||
// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
|
// TODO refresh should check if the active item is still in the dom, removing the need for a manual deactivate
|
||||||
this.menu.deactivate();
|
this.menu.deactivate();
|
||||||
this.menu.refresh();
|
this.menu.refresh();
|
||||||
this.menu.element.show().position({
|
this.menu.element.show().position( $.extend({
|
||||||
my: "left top",
|
of: this.element
|
||||||
at: "left bottom",
|
}, this.options.position ));
|
||||||
of: this.element,
|
|
||||||
collision: "none"
|
|
||||||
});
|
|
||||||
|
|
||||||
menuWidth = ul.width( "" ).width();
|
menuWidth = ul.width( "" ).outerWidth();
|
||||||
textWidth = this.element.width();
|
textWidth = this.element.outerWidth();
|
||||||
ul.width( Math.max( menuWidth, textWidth ) );
|
ul.width( Math.max( menuWidth, textWidth )
|
||||||
|
- ( parseFloat( ul.css("paddingLeft") ) || 0 )
|
||||||
|
- ( parseFloat( ul.css("paddingRight") ) || 0 )
|
||||||
|
- ( parseFloat( ul.css("borderLeftWidth") ) || 0 )
|
||||||
|
- ( parseFloat( ul.css("borderRightWidth") ) || 0 ) );
|
||||||
},
|
},
|
||||||
|
|
||||||
_renderMenu: function( ul, items ) {
|
_renderMenu: function( ul, items ) {
|
||||||
@ -291,7 +304,7 @@ $.widget( "ui.autocomplete", {
|
|||||||
_renderItem: function( ul, item) {
|
_renderItem: function( ul, item) {
|
||||||
return $( "<li></li>" )
|
return $( "<li></li>" )
|
||||||
.data( "item.autocomplete", item )
|
.data( "item.autocomplete", item )
|
||||||
.append( "<a>" + item.label + "</a>" )
|
.append( $( "<a></a>" ).text( item.label ) )
|
||||||
.appendTo( ul );
|
.appendTo( ul );
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -426,11 +439,11 @@ $.widget("ui.menu", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
first: function() {
|
first: function() {
|
||||||
return this.active && !this.active.prev().length;
|
return this.active && !this.active.prevAll(".ui-menu-item").length;
|
||||||
},
|
},
|
||||||
|
|
||||||
last: function() {
|
last: function() {
|
||||||
return this.active && !this.active.next().length;
|
return this.active && !this.active.nextAll(".ui-menu-item").length;
|
||||||
},
|
},
|
||||||
|
|
||||||
move: function(direction, edge, event) {
|
move: function(direction, edge, event) {
|
||||||
|
2
ui/jquery.ui.button.js
vendored
@ -196,7 +196,7 @@ $.widget( "ui.button", {
|
|||||||
// we don't search against the document in case the element
|
// we don't search against the document in case the element
|
||||||
// is disconnected from the DOM
|
// is disconnected from the DOM
|
||||||
this.buttonElement = this.element.parents().last()
|
this.buttonElement = this.element.parents().last()
|
||||||
.find( "[for=" + this.element.attr("id") + "]" );
|
.find( "label[for=" + this.element.attr("id") + "]" );
|
||||||
this.element.addClass( "ui-helper-hidden-accessible" );
|
this.element.addClass( "ui-helper-hidden-accessible" );
|
||||||
|
|
||||||
var checked = this.element.is( ":checked" );
|
var checked = this.element.is( ":checked" );
|
||||||
|
12
ui/jquery.ui.dialog.js
vendored
@ -59,6 +59,7 @@ $.widget("ui.dialog", {
|
|||||||
width: 300,
|
width: 300,
|
||||||
zIndex: 1000
|
zIndex: 1000
|
||||||
},
|
},
|
||||||
|
|
||||||
_create: function() {
|
_create: function() {
|
||||||
this.originalTitle = this.element.attr('title');
|
this.originalTitle = this.element.attr('title');
|
||||||
// #5742 - .attr() might return a DOMElement
|
// #5742 - .attr() might return a DOMElement
|
||||||
@ -177,6 +178,7 @@ $.widget("ui.dialog", {
|
|||||||
uiDialog.bgiframe();
|
uiDialog.bgiframe();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_init: function() {
|
_init: function() {
|
||||||
if ( this.options.autoOpen ) {
|
if ( this.options.autoOpen ) {
|
||||||
this.open();
|
this.open();
|
||||||
@ -322,12 +324,9 @@ $.widget("ui.dialog", {
|
|||||||
|
|
||||||
// set focus to the first tabbable element in the content area or the first button
|
// set focus to the first tabbable element in the content area or the first button
|
||||||
// if there are no tabbable elements, set focus on the dialog itself
|
// if there are no tabbable elements, set focus on the dialog itself
|
||||||
$([])
|
$(self.element.find(':tabbable').get().concat(
|
||||||
.add(uiDialog.find('.ui-dialog-content :tabbable:first'))
|
uiDialog.find('.ui-dialog-buttonpane :tabbable').get().concat(
|
||||||
.add(uiDialog.find('.ui-dialog-buttonpane :tabbable:first'))
|
uiDialog.get()))).eq(0).focus();
|
||||||
.add(uiDialog)
|
|
||||||
.filter(':first')
|
|
||||||
.focus();
|
|
||||||
|
|
||||||
self._trigger('open');
|
self._trigger('open');
|
||||||
self._isOpen = true;
|
self._isOpen = true;
|
||||||
@ -461,7 +460,6 @@ $.widget("ui.dialog", {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
_position: function(position) {
|
_position: function(position) {
|
||||||
var myAt = [],
|
var myAt = [],
|
||||||
offset = [0, 0],
|
offset = [0, 0],
|
||||||
|
4
ui/jquery.ui.sortable.js
vendored
@ -409,6 +409,10 @@ $.widget("ui.sortable", $.ui.mouse, {
|
|||||||
if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
|
if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if(!str.length && o.key) {
|
||||||
|
str.push(o.key + '=');
|
||||||
|
}
|
||||||
|
|
||||||
return str.join('&');
|
return str.join('&');
|
||||||
|
|
||||||
},
|
},
|
||||||
|
28
ui/jquery.ui.tabs.js
vendored
@ -413,6 +413,16 @@ $.widget("ui.tabs", {
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
_getIndex: function(index) {
|
||||||
|
// meta-function to give users option to provide a href string instead of a numerical index.
|
||||||
|
// also sanitizes numerical indexes to valid values.
|
||||||
|
if (typeof index == 'string') {
|
||||||
|
index = this.anchors.index(this.anchors.filter('[href$=' + index + ']'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return index;
|
||||||
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
var o = this.options;
|
var o = this.options;
|
||||||
|
|
||||||
@ -512,6 +522,7 @@ $.widget("ui.tabs", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
remove: function(index) {
|
remove: function(index) {
|
||||||
|
index = this._getIndex(index);
|
||||||
var o = this.options, $li = this.lis.eq(index).remove(),
|
var o = this.options, $li = this.lis.eq(index).remove(),
|
||||||
$panel = this.panels.eq(index).remove();
|
$panel = this.panels.eq(index).remove();
|
||||||
|
|
||||||
@ -532,6 +543,7 @@ $.widget("ui.tabs", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
enable: function(index) {
|
enable: function(index) {
|
||||||
|
index = this._getIndex(index);
|
||||||
var o = this.options;
|
var o = this.options;
|
||||||
if ($.inArray(index, o.disabled) == -1) {
|
if ($.inArray(index, o.disabled) == -1) {
|
||||||
return;
|
return;
|
||||||
@ -546,6 +558,7 @@ $.widget("ui.tabs", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
disable: function(index) {
|
disable: function(index) {
|
||||||
|
index = this._getIndex(index);
|
||||||
var self = this, o = this.options;
|
var self = this, o = this.options;
|
||||||
if (index != o.selected) { // cannot disable already selected tab
|
if (index != o.selected) { // cannot disable already selected tab
|
||||||
this.lis.eq(index).addClass('ui-state-disabled');
|
this.lis.eq(index).addClass('ui-state-disabled');
|
||||||
@ -561,21 +574,20 @@ $.widget("ui.tabs", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
select: function(index) {
|
select: function(index) {
|
||||||
if (typeof index == 'string') {
|
index = this._getIndex(index);
|
||||||
index = this.anchors.index(this.anchors.filter('[href$=' + index + ']'));
|
if (index == -1) {
|
||||||
}
|
if (this.options.collapsible && this.options.selected != -1) {
|
||||||
else if (index === null) { // usage of null is deprecated, TODO remove in next release
|
|
||||||
index = -1;
|
|
||||||
}
|
|
||||||
if (index == -1 && this.options.collapsible) {
|
|
||||||
index = this.options.selected;
|
index = this.options.selected;
|
||||||
|
} else {
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.anchors.eq(index).trigger(this.options.event + '.tabs');
|
this.anchors.eq(index).trigger(this.options.event + '.tabs');
|
||||||
return this;
|
return this;
|
||||||
},
|
},
|
||||||
|
|
||||||
load: function(index) {
|
load: function(index) {
|
||||||
|
index = this._getIndex(index);
|
||||||
var self = this, o = this.options, a = this.anchors.eq(index)[0], url = $.data(a, 'load.tabs');
|
var self = this, o = this.options, a = this.anchors.eq(index)[0], url = $.data(a, 'load.tabs');
|
||||||
|
|
||||||
this.abort();
|
this.abort();
|
||||||
|
2
ui/jquery.ui.widget.js
vendored
@ -57,7 +57,7 @@ $.widget = function( name, base, prototype ) {
|
|||||||
// basePrototype[ key ] = $.extend( {}, val );
|
// basePrototype[ key ] = $.extend( {}, val );
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
basePrototype.options = $.extend( {}, basePrototype.options );
|
basePrototype.options = $.extend( true, {}, basePrototype.options );
|
||||||
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
|
$[ namespace ][ name ].prototype = $.extend( true, basePrototype, {
|
||||||
namespace: namespace,
|
namespace: namespace,
|
||||||
widgetName: name,
|
widgetName: name,
|
||||||
|