diff options
-rw-r--r-- | AUTHORS.txt | 42 | ||||
-rw-r--r-- | build/.jshintrc | 13 | ||||
-rw-r--r-- | build/release/release.js | 38 | ||||
-rw-r--r-- | build/tasks/build.js | 4 | ||||
-rw-r--r-- | demos/datepicker/date-range.html | 4 | ||||
-rw-r--r-- | demos/position/cycler.html | 2 | ||||
-rw-r--r-- | demos/spinner/currency.html | 2 | ||||
-rw-r--r-- | demos/tooltip/custom-style.html | 4 | ||||
-rw-r--r-- | grunt.js | 2 | ||||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | tests/jquery.simulate.js | 2 | ||||
-rw-r--r-- | tests/unit/datepicker/datepicker_core.js | 4 | ||||
-rw-r--r-- | tests/unit/tabs/tabs_options.js | 8 | ||||
-rw-r--r-- | tests/unit/tooltip/tooltip_methods.js | 30 | ||||
-rw-r--r-- | themes/base/jquery.ui.autocomplete.css | 6 | ||||
-rw-r--r-- | themes/base/jquery.ui.theme.css | 2 | ||||
-rw-r--r-- | ui/jquery.ui.core.js | 8 | ||||
-rw-r--r-- | ui/jquery.ui.datepicker.js | 2 | ||||
-rw-r--r-- | ui/jquery.ui.dialog.js | 6 | ||||
-rw-r--r-- | ui/jquery.ui.draggable.js | 18 | ||||
-rw-r--r-- | ui/jquery.ui.mouse.js | 2 | ||||
-rw-r--r-- | ui/jquery.ui.resizable.js | 4 | ||||
-rw-r--r-- | ui/jquery.ui.sortable.js | 31 | ||||
-rw-r--r-- | ui/jquery.ui.tabs.js | 11 | ||||
-rw-r--r-- | ui/jquery.ui.tooltip.js | 22 |
25 files changed, 199 insertions, 70 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt index 892e2ec76..a53bc9dc2 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -4,14 +4,14 @@ A list of current team members is available at http://jqueryui.com/about Paul Bakaus <paul.bakaus@googlemail.com> Richard Worth <rdworth@gmail.com> Yehuda Katz <wycats@gmail.com> -Sean Catchpole <littlecooldude@gmail.com> +Sean Catchpole <sean@sunsean.com> John Resig <jeresig@gmail.com> -Tane Piper <tane@tanepiper.com> +Tane Piper <piper.tane@gmail.com> Dmitri Gaskin <dmitrig01@gmail.com> Klaus Hartl <klaus.hartl@googlemail.com> Stefan Petre <stefan.petre@gmail.com> Gilles van den Hoven <gilles@webunity.nl> -Micheil Smith <micheil@brandedcode.com> +Micheil Bryan Smith <micheil@brandedcode.com> Jörn Zaefferer <joern.zaefferer@gmail.com> Marc Grabanski <m@marcgrabanski.com> Keith Wood <kbwood.au@gmail.com> @@ -81,9 +81,9 @@ Khaled AlHourani <me@khaledalhourani.com> Marian Rudzynski <mr@impaled.org> Jean-Francois Remy <jfremy@virtuoz.com> Doug Blood <dougblood@gmail.com> -Filippo Cavallarin <poplix@papuasia.org> +Filippo Cavallarin <filippo.cavallarin@codseq.it> Heiko Henning <h.henning@educa.ch> -Aliaxandr Rahalevich <saksmlz@gmail.com> +Aliaksandr Rahalevich <saksmlz@gmail.com> Mario Visic <mario@mariovisic.com> Xavi Ramirez <xavi.rmz@gmail.com> Max Schnur <max.schnur@gmail.com> @@ -92,7 +92,7 @@ Corey Frang <gnarf@gnarf.net> Aaron Peterson <aaronp123@yahoo.com> Ivan Peters <ivan@ivanpeters.com> Mohamed Cherif Bouchelaghem <cherifbouchelaghem@yahoo.fr> -Marcos Sousa <marcos.sousa@corp.globo.com> +Marcos Sousa <falecomigo@marcossousa.com> Michael DellaNoce <mdellanoce@mailtrust.com> George Marshall <echosx@gmail.com> Tobias Brunner <tobias@strongswan.org> @@ -114,8 +114,8 @@ Hans Hillen <hans.hillen@gmail.com> Mark Johnson <virgofx@live.com> Trey Hunner <treyhunner@gmail.com> Shane Whittet <whittet@gmail.com> -Edward Faulkner <ef@alum.mit.edu> -Adam Baratz <adam.baratz@gmail.com> +Edward A Faulkner <ef@alum.mit.edu> +Adam Baratz <adam@adambaratz.com> Kato Kazuyoshi <kato.kazuyoshi@gmail.com> Eike Send <eike.send@gmail.com> Kris Borchers <kris.borchers@gmail.com> @@ -125,27 +125,27 @@ Carson McDonald <carson@ioncannon.net> Jason Davies <jason@jasondavies.com> Garrison Locke <gplocke@gmail.com> David Murdoch <musicisair@yahoo.com> -Ben Boyle <benjamins.boyle@gmail.com> +Benjamin Scott Boyle <benjamins.boyle@gmail.com> Jesse Baird <jebaird@gmail.com> Jonathan Vingiano <jvingiano@gmail.com> Dylan Just <dev@ephox.com> -Tomy Kaira <tomykaira@gmail.com> +Hiroshi Tomita <tomykaira@gmail.com> Glenn Goodrich <glenn.goodrich@gmail.com> -Ashek Elahi <mail.ashek@gmail.com> +Tarafder Ashek-E-Elahi <mail.ashek@gmail.com> Ryan Neufeld <ryan@neufeldmail.com> Marc Neuwirth <marc.neuwirth@gmail.com> Philip Graham <philip.robert.graham@gmail.com> Benjamin Sterling <benjamin.sterling@kenzomedia.com> -Wesley Walser <wwalser@atlassian.com> +Wesley Walser <waw325@gmail.com> Kouhei Sutou <kou@clear-code.com> -Karl Kirch <karl.ctr.kirch@faa.gov> +Karl Kirch <karlkrch@gmail.com> Chris Kelly <ckdake@ckdake.com> Jay Oster <jay@loyalize.com> -Alex Polomoshnov <alex.polomoshnov@gmail.com> +Alexander Polomoshnov <alex.polomoshnov@gmail.com> David Leal <dgleal@gmail.com> -igor milla <igor.fsp.milla@gmail.com> +Igor Milla <igor.fsp.milla@gmail.com> Dave Methvin <dave.methvin@gmail.com> -Florian Gutmann <blackfeet@gmx.at> +Florian Gutmann <f.gutmann@chronimo.com> Marwan Al Jubeh <marwan.aljubeh@gmail.com> Milan Broum <midlis@googlemail.com> Sebastian Sauer <info@dynpages.de> @@ -157,7 +157,7 @@ David Soms <david.soms@gmail.com> David De Sloovere <david.desloovere@hotmail.com> Michael P. Jung <michael.jung@terreon.de> Shannon Pekary <spekary@gmail.com> -Matthew Hutton <meh@corefiling.co.uk> +Matthew Edward Hutton <meh@corefiling.co.uk> James Khoury <james@jameskhoury.com> Rob Loach <robloach@gmail.com> Alberto Monteiro <betimbrasil@gmail.com> @@ -168,7 +168,7 @@ Genie <386@mail.com> Rick Waldron <waldron.rick@gmail.com> Ian Simpson <spoonlikesham@gmail.com> Lev Kitsis <spam4lev@gmail.com> -TJ VanToll <tj.vantoll@gmail.com> +Ted VanToll <tj.vantoll@gmail.com> Justin Domnitz <jdomnitz@gmail.com> Douglas Cerna <douglascerna@yahoo.com> Bert ter Heide <bertjh@hotmail.com> @@ -189,11 +189,11 @@ Eneko Illarramendi <eneko@illarra.com> EungJun Yi <semtlenori@gmail.com> Courtland Allen <courtlandallen@gmail.com> Viktar Varvanovich <non4eg@gmail.com> -Danny Trunk <dtrunk90@googlemail.com> +Danny Trunk <dtrunk90@gmail.com> Pavel Stetina <pavel.stetina@nangu.tv> -Mike Stay <metaweta@gmail.com> +Michael Stay <metaweta@gmail.com> Steven Roussey <sroussey@gmail.com> -Mike Hollis <hollis21@gmail.com> +Michael Hollis <hollis21@gmail.com> Lee Rowlands <lee.rowlands@previousnext.com.au> Timmy Willison <timmywillisn@gmail.com> Karl Swedberg <kswedberg@gmail.com> diff --git a/build/.jshintrc b/build/.jshintrc new file mode 100644 index 000000000..9e6abf31d --- /dev/null +++ b/build/.jshintrc @@ -0,0 +1,13 @@ +{ + "curly": true, + "eqnull": true, + "eqeqeq": true, + "expr": true, + "noarg": true, + "node": true, + "onevar": true, + "smarttabs": true, + "strict": false, + "trailing": true, + "undef": true +} diff --git a/build/release/release.js b/build/release/release.js index 9a0f9a9e7..77430d8d1 100644 --- a/build/release/release.js +++ b/build/release/release.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +/*global cat:true cd:true cp:true echo:true exec:true exit:true ls:true*/ var baseDir, repoDir, prevVersion, newVersion, nextVersion, tagTime, fs = require( "fs" ), @@ -40,6 +41,9 @@ walk([ section( "gathering contributors" ), gatherContributors, + section( "generating quick download" ), + generateQuickDownload, + section( "updating trac" ), updateTrac, confirm @@ -250,13 +254,41 @@ function gatherContributors() { echo ( "Adding people thanked in commits..." ); contributors = contributors.concat( gitLog( "%b%n%s" ).filter(function( line ) { - return /thank/i.test( line ); + return (/thank/i).test( line ); })); fs.writeFileSync( contributorsPath, contributors.join( "\n" ) ); echo( "Stored contributors in " + contributorsPath.cyan + "." ); } +function generateQuickDownload() { + var config, + downloadDir = repoDir + "/node_modules/download.jqueryui.com", + filename = "jquery-ui-" + newVersion + ".custom.zip", + destination = baseDir + "/" + filename; + + cd( downloadDir ); + + // Update jQuery UI version for download builder + config = JSON.parse( cat( "config.json" ) ); + config.jqueryUi = newVersion; + JSON.stringify( config ).to( "config.json" ); + + // Generate quick download + // TODO: Find a way to avoid having to clone jquery-ui inside download builder + if ( exec( "grunt prepare build" ).code !== 0 ) { + abort( "Error generating quick download." ); + } + cp( downloadDir + "/release/" + filename, destination ); + // cp() doesn't have error handling, so check for the file + if ( ls( destination ).length !== 1 ) { + abort( "Error copying quick download." ); + } + + // Go back to repo directory for consistency + cd( repoDir ); +} + function updateTrac() { echo( newVersion.cyan + " was tagged at " + tagTime.cyan + "." ); echo( "Close the " + newVersion.cyan + " Milestone with the above date and time." ); @@ -347,8 +379,8 @@ function bootstrap( fn ) { return process.exit( 1 ); } - require( baseDir + "/node_modules/shelljs/global" ); - require( baseDir + "/node_modules/colors" ); + require( "shelljs/global" ); + require( "colors" ); fn(); }); diff --git a/build/tasks/build.js b/build/tasks/build.js index 2f191b69a..3f3dd31c5 100644 --- a/build/tasks/build.js +++ b/build/tasks/build.js @@ -177,8 +177,8 @@ grunt.registerTask( "generate_themes", function() { distFolder = "dist/" + grunt.template.process( grunt.config( "files.dist" ), grunt.config() ); try { require.resolve( "download.jqueryui.com" ); - } catch( e ) { - throw "You need to manually install download.jqueryui.com for this task to work"; + } catch( error ) { + throw new Error( "You need to manually install download.jqueryui.com for this task to work" ); } // copy release files into download builder to avoid cloning again diff --git a/demos/datepicker/date-range.html b/demos/datepicker/date-range.html index 284b6b3be..7fd8f321c 100644 --- a/demos/datepicker/date-range.html +++ b/demos/datepicker/date-range.html @@ -15,7 +15,7 @@ defaultDate: "+1w", changeMonth: true, numberOfMonths: 3, - onSelect: function( selectedDate ) { + onClose: function( selectedDate ) { $( "#to" ).datepicker( "option", "minDate", selectedDate ); } }); @@ -23,7 +23,7 @@ defaultDate: "+1w", changeMonth: true, numberOfMonths: 3, - onSelect: function( selectedDate ) { + onClose: function( selectedDate ) { $( "#from" ).datepicker( "option", "maxDate", selectedDate ); } }); diff --git a/demos/position/cycler.html b/demos/position/cycler.html index dc3bbc86e..2c421211f 100644 --- a/demos/position/cycler.html +++ b/demos/position/cycler.html @@ -2,7 +2,7 @@ <html lang="en"> <head> <meta charset="utf-8"> - <title>jQuery UI Position - Default functionality</title> + <title>jQuery UI Position - Image Cycler</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> <script src="../../jquery-1.8.2.js"></script> <script src="../../ui/jquery.ui.core.js"></script> diff --git a/demos/spinner/currency.html b/demos/spinner/currency.html index f15511ab7..0b9975808 100644 --- a/demos/spinner/currency.html +++ b/demos/spinner/currency.html @@ -2,7 +2,7 @@ <html lang="en"> <head> <meta charset="utf-8"> - <title>jQuery UI Spinner - Default functionality</title> + <title>jQuery UI Spinner - Currency</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.all.css"> <script src="../../jquery-1.8.2.js"></script> <script src="../../external/jquery.mousewheel.js"></script> diff --git a/demos/tooltip/custom-style.html b/demos/tooltip/custom-style.html index f18522e54..d3546d3b3 100644 --- a/demos/tooltip/custom-style.html +++ b/demos/tooltip/custom-style.html @@ -2,7 +2,7 @@ <html lang="en"> <head> <meta charset="utf-8"> - <title>jQuery UI Tooltip - Default functionality</title> + <title>jQuery UI Tooltip - Custom Styling</title> <link rel="stylesheet" href="../../themes/base/jquery.ui.tooltip.css"> <script src="../../jquery-1.8.2.js"></script> <script src="../../ui/jquery.ui.core.js"></script> @@ -85,7 +85,7 @@ the element with your mouse, the title attribute is displayed in a little box ne <a href="http://themeroller.com" title="ThemeRoller: jQuery UI's theme builder application">ThemeRoller</a> will also style tooltips accordingly.</p> <p>Tooltips are also useful for form elements, to show some additional information in the context of each field.</p> -<p><label for="age">Your age:</label><input id="age" title="We ask for your age only for statistical purposes."></p> +<p><label for="age">Your age:</label> <input id="age" title="We ask for your age only for statistical purposes."></p> <p>Hover the field to see the tooltip.</p> <div class="demo-description"> @@ -287,7 +287,7 @@ grunt.initConfig({ // TODO remove items from this list once rewritten return !( /(mouse|datepicker|draggable|droppable|resizable|selectable|sortable)\.js$/ ).test( file ); }), - grunt: [ "grunt.js", "build/tasks/*.js" ], + grunt: [ "grunt.js", "build/**/*.js" ], tests: "tests/unit/**/*.js" }, csslint: { diff --git a/package.json b/package.json index 554dfe061..3625c1f44 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "jquery-ui", "title": "jQuery UI", "description": "A curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library.", - "version": "1.9.0pre", + "version": "1.9.1pre", "homepage": "http://jqueryui.com", "author": { "name": "jQuery Foundation and other contributors", diff --git a/tests/jquery.simulate.js b/tests/jquery.simulate.js index e281e2fee..790c88c27 100644 --- a/tests/jquery.simulate.js +++ b/tests/jquery.simulate.js @@ -148,7 +148,7 @@ $.extend( $.simulate.prototype, { } // TODO: can we hook into core's logic? - if ( $.browser.msie || $.browser.opera ) { + if ( $.ui.ie || (({}).toString.call( window.opera ) === "[object Opera]") ) { // TODO: is charCode ever <0 ? Can we just use charCode || keyCode? event.keyCode = (options.charCode > 0) ? options.charCode : options.keyCode; event.charCode = undefined; diff --git a/tests/unit/datepicker/datepicker_core.js b/tests/unit/datepicker/datepicker_core.js index 17cefe157..e17b239e5 100644 --- a/tests/unit/datepicker/datepicker_core.js +++ b/tests/unit/datepicker/datepicker_core.js @@ -59,7 +59,7 @@ test('baseStructure', function() { var header, title, table, thead, week, panel, inl, child, inp = init('#inp').focus(), dp = $('#ui-datepicker-div'), - iframe = ($.browser.msie && parseInt($.browser.version, 10) < 7); + iframe = ($.ui.ie6); ok(dp.is(':visible'), 'Structure - datepicker visible'); ok(!dp.is('.ui-datepicker-rtl'), 'Structure - not right-to-left'); ok(!dp.is('.ui-datepicker-multi'), 'Structure - not multi-month'); @@ -186,7 +186,7 @@ test('customStructure', function() { inp = init('#inp', $.datepicker.regional.he); inp.data('showButtonPanel.datepicker',true); inp.focus(); - iframe = ($.browser.msie && parseInt($.browser.version, 10) < 7); + iframe = ($.ui.ie6); ok(dp.is('.ui-datepicker-rtl'), 'Structure RTL - right-to-left'); header = dp.children(':first'); ok(header.is('div.ui-datepicker-header'), 'Structure RTL - header division'); diff --git a/tests/unit/tabs/tabs_options.js b/tests/unit/tabs/tabs_options.js index 5a90ff895..1b468f2b6 100644 --- a/tests/unit/tabs/tabs_options.js +++ b/tests/unit/tabs/tabs_options.js @@ -7,7 +7,7 @@ var disabled = TestHelpers.tabs.disabled, module( "tabs: options" ); test( "{ active: default }", function() { - expect( 4 ); + expect( 6 ); var element = $( "#tabs1" ).tabs(); equal( element.tabs( "option", "active" ), 0, "should be 0 by default" ); @@ -19,6 +19,12 @@ test( "{ active: default }", function() { equal( element.tabs( "option", "active" ), 2, "should be 2 based on URL" ); state( element, 0, 0, 1 ); element.tabs( "destroy" ); + + location.hash = "#custom-id"; + element = $( "#tabs2" ).tabs(); + equal( element.tabs( "option", "active" ), 3, "should be 3 based on URL" ); + state( element, 0, 0, 0, 1, 0 ); + element.tabs( "destroy" ); location.hash = "#"; }); diff --git a/tests/unit/tooltip/tooltip_methods.js b/tests/unit/tooltip/tooltip_methods.js index 0af1e06e9..c846d216c 100644 --- a/tests/unit/tooltip/tooltip_methods.js +++ b/tests/unit/tooltip/tooltip_methods.js @@ -3,13 +3,20 @@ module( "tooltip: methods" ); test( "destroy", function() { - expect( 2 ); + expect( 3 ); + var element = $( "#tooltipped1" ); + domEqual( "#tooltipped1", function() { - $( "#tooltipped1" ).tooltip().tooltip( "destroy" ); + element.tooltip().tooltip( "destroy" ); }); // make sure that open tooltips are removed on destroy - $( "#tooltipped1" ).tooltip().tooltip( "open" ).tooltip( "destroy" ); + domEqual( "#tooltipped1", function() { + element + .tooltip() + .tooltip( "open", $.Event( "mouseover", { target: element[0] }) ) + .tooltip( "destroy" ); + }); equal( $( ".ui-tooltip" ).length, 0 ); }); @@ -29,6 +36,23 @@ test( "open/close", function() { $.fx.off = false; }); +// #8626 - Calling open() without an event +test( "open/close with tracking", function() { + expect( 3 ); + $.fx.off = true; + var tooltip, + element = $( "#tooltipped1" ).tooltip({ track: true }); + equal( $( ".ui-tooltip" ).length, 0, "no tooltip on init" ); + + element.tooltip( "open" ); + tooltip = $( "#" + element.data( "ui-tooltip-id" ) ); + ok( tooltip.is( ":visible" ) ); + + element.tooltip( "close" ); + ok( tooltip.is( ":hidden" ) ); + $.fx.off = false; +}); + test( "enable/disable", function() { expect( 7 ); $.fx.off = true; diff --git a/themes/base/jquery.ui.autocomplete.css b/themes/base/jquery.ui.autocomplete.css index cc85c5a4e..05ae3108f 100644 --- a/themes/base/jquery.ui.autocomplete.css +++ b/themes/base/jquery.ui.autocomplete.css @@ -8,7 +8,11 @@ * * http://docs.jquery.com/UI/Autocomplete#theming */ -.ui-autocomplete { position: absolute; cursor: default; } +.ui-autocomplete { + position: absolute; + top: 0; /* #8656 */ + cursor: default; +} /* workarounds */ * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ diff --git a/themes/base/jquery.ui.theme.css b/themes/base/jquery.ui.theme.css index 12a39fb86..d70b9df90 100644 --- a/themes/base/jquery.ui.theme.css +++ b/themes/base/jquery.ui.theme.css @@ -27,7 +27,7 @@ .ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3/*{borderColorDefault}*/; background: #e6e6e6/*{bgColorDefault}*/ url(images/ui-bg_glass_75_e6e6e6_1x400.png)/*{bgImgUrlDefault}*/ 50%/*{bgDefaultXPos}*/ 50%/*{bgDefaultYPos}*/ repeat-x/*{bgDefaultRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #555555/*{fcDefault}*/; } .ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555/*{fcDefault}*/; text-decoration: none; } .ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999/*{borderColorHover}*/; background: #dadada/*{bgColorHover}*/ url(images/ui-bg_glass_75_dadada_1x400.png)/*{bgImgUrlHover}*/ 50%/*{bgHoverXPos}*/ 50%/*{bgHoverYPos}*/ repeat-x/*{bgHoverRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcHover}*/; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121/*{fcHover}*/; text-decoration: none; } +.ui-state-hover a, .ui-state-hover a:hover, .ui-state-hover a:link, .ui-state-hover a:visited { color: #212121/*{fcHover}*/; text-decoration: none; } .ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa/*{borderColorActive}*/; background: #ffffff/*{bgColorActive}*/ url(images/ui-bg_glass_65_ffffff_1x400.png)/*{bgImgUrlActive}*/ 50%/*{bgActiveXPos}*/ 50%/*{bgActiveYPos}*/ repeat-x/*{bgActiveRepeat}*/; font-weight: normal/*{fwDefault}*/; color: #212121/*{fcActive}*/; } .ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121/*{fcActive}*/; text-decoration: none; } diff --git a/ui/jquery.ui.core.js b/ui/jquery.ui.core.js index bb9411dc9..e569eea42 100644 --- a/ui/jquery.ui.core.js +++ b/ui/jquery.ui.core.js @@ -69,7 +69,7 @@ $.fn.extend({ scrollParent: function() { var scrollParent; - if (($.browser.msie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { + if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) { scrollParent = this.parents().filter(function() { return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x')); }).eq(0); @@ -258,6 +258,12 @@ $(function() { // deprecated +(function() { + var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || []; + $.ui.ie = uaMatch.length ? true : false; + $.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6; +})(); + $.fn.extend({ disableSelection: function() { return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) + diff --git a/ui/jquery.ui.datepicker.js b/ui/jquery.ui.datepicker.js index 9ea36924b..4643af2eb 100644 --- a/ui/jquery.ui.datepicker.js +++ b/ui/jquery.ui.datepicker.js @@ -1605,7 +1605,7 @@ $.extend(Datepicker.prototype, { } html += group; } - html += buttonPanel + ($.browser.msie && parseInt($.browser.version,10) < 7 && !inst.inline ? + html += buttonPanel + ($.ui.ie6 && !inst.inline ? '<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>' : ''); inst._keyEvent = false; return html; diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 77424047c..8593fff85 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -364,7 +364,7 @@ $.widget("ui.dialog", { props = $.isFunction( props ) ? { click: props, text: name } : props; - var button = $( "<button type='button'>" ) + var button = $( "<button type='button'></button>" ) .attr( props, true ) .unbind( "click" ) .click(function() { @@ -768,7 +768,7 @@ $.extend( $.ui.dialog.overlay, { var scrollHeight, offsetHeight; // handle IE - if ( $.browser.msie ) { + if ( $.ui.ie ) { scrollHeight = Math.max( document.documentElement.scrollHeight, document.body.scrollHeight @@ -793,7 +793,7 @@ $.extend( $.ui.dialog.overlay, { var scrollWidth, offsetWidth; // handle IE - if ( $.browser.msie ) { + if ( $.ui.ie ) { scrollWidth = Math.max( document.documentElement.scrollWidth, document.body.scrollWidth diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 2e33e3311..5d91a3d94 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -318,7 +318,7 @@ $.widget("ui.draggable", $.ui.mouse, { } if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix po = { top: 0, left: 0 }; return { @@ -571,13 +571,29 @@ $.ui.plugin.add("draggable", "connectToSortable", { $.each(inst.sortables, function(i) { + var innermostIntersecting = false; + var thisSortable = this; //Copy over some variables to allow calling the sortable's native _intersectsWith this.instance.positionAbs = inst.positionAbs; this.instance.helperProportions = inst.helperProportions; this.instance.offset.click = inst.offset.click; if(this.instance._intersectsWith(this.instance.containerCache)) { + innermostIntersecting = true; + $.each(inst.sortables, function () { + this.instance.positionAbs = inst.positionAbs; + this.instance.helperProportions = inst.helperProportions; + this.instance.offset.click = inst.offset.click; + if (this != thisSortable + && this.instance._intersectsWith(this.instance.containerCache) + && $.ui.contains(thisSortable.instance.element[0], this.instance.element[0])) + innermostIntersecting = false; + return innermostIntersecting; + }); + } + + if(innermostIntersecting) { //If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once if(!this.instance.isOver) { diff --git a/ui/jquery.ui.mouse.js b/ui/jquery.ui.mouse.js index 30546ffc4..f5069d00c 100644 --- a/ui/jquery.ui.mouse.js +++ b/ui/jquery.ui.mouse.js @@ -111,7 +111,7 @@ $.widget("ui.mouse", { _mouseMove: function(event) { // IE mouseup check - mouseup happened when mouse was out of window - if ($.browser.msie && !(document.documentMode >= 9) && !event.button) { + if ($.ui.ie && !(document.documentMode >= 9) && !event.button) { return this._mouseUp(event); } diff --git a/ui/jquery.ui.resizable.js b/ui/jquery.ui.resizable.js index 724ae9ddf..cc82b8b92 100644 --- a/ui/jquery.ui.resizable.js +++ b/ui/jquery.ui.resizable.js @@ -466,8 +466,8 @@ $.widget("ui.resizable", $.ui.mouse, { this.helper = this.helper || $('<div style="overflow:hidden;"></div>'); // fix ie6 offset TODO: This seems broken - var ie6 = $.browser.msie && $.browser.version < 7, ie6offset = (ie6 ? 1 : 0), - pxyoffset = ( ie6 ? 2 : -1 ); + var ie6offset = ($.ui.ie6 ? 1 : 0), + pxyoffset = ( $.ui.ie6 ? 2 : -1 ); this.helper.addClass(this._helper).css({ width: this.element.outerWidth() + pxyoffset, diff --git a/ui/jquery.ui.sortable.js b/ui/jquery.ui.sortable.js index 070dff6cd..a2132a9bd 100644 --- a/ui/jquery.ui.sortable.js +++ b/ui/jquery.ui.sortable.js @@ -562,14 +562,13 @@ $.widget("ui.sortable", $.ui.mouse, { var list = this.currentItem.find(":data(" + this.widgetName + "-item)"); - for (var i=0; i < this.items.length; i++) { - + this.items = $.grep(this.items, function (item) { for (var j=0; j < list.length; j++) { - if(list[j] == this.items[i].item[0]) - this.items.splice(i,1); + if(list[j] == item.item[0]) + return false; }; - - }; + return true; + }); }, @@ -735,16 +734,26 @@ $.widget("ui.sortable", $.ui.mouse, { if(this.containers.length === 1) { this.containers[innermostIndex]._trigger("over", event, this._uiHash(this)); this.containers[innermostIndex].containerCache.over = 1; - } else if(this.currentContainer != this.containers[innermostIndex]) { + } else { //When entering a new container, we will find the item with the least distance and append our item near it - var dist = 10000; var itemWithLeastDistance = null; var base = this.positionAbs[this.containers[innermostIndex].floating ? 'left' : 'top']; + var dist = 10000; var itemWithLeastDistance = null; + var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top'; + var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height'; + var base = this.positionAbs[posProperty] + this.offset.click[posProperty]; for (var j = this.items.length - 1; j >= 0; j--) { if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue; - var cur = this.containers[innermostIndex].floating ? this.items[j].item.offset().left : this.items[j].item.offset().top; + if(this.items[j].item[0] == this.currentItem[0]) continue; + var cur = this.items[j].item.offset()[posProperty]; + var nearBottom = false; + if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){ + nearBottom = true; + cur += this.items[j][sizeProperty]; + } + if(Math.abs(cur - base) < dist) { dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j]; - this.direction = (cur - base > 0) ? 'down' : 'up'; + this.direction = nearBottom ? "up": "down"; } } @@ -822,7 +831,7 @@ $.widget("ui.sortable", $.ui.mouse, { } if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information - || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.browser.msie)) //Ugly IE fix + || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix po = { top: 0, left: 0 }; return { diff --git a/ui/jquery.ui.tabs.js b/ui/jquery.ui.tabs.js index 506ee27d7..7d38fb46e 100644 --- a/ui/jquery.ui.tabs.js +++ b/ui/jquery.ui.tabs.js @@ -51,7 +51,8 @@ $.widget( "ui.tabs", { var panel, that = this, options = this.options, - active = options.active; + active = options.active, + locationHash = location.hash.substring( 1 ); this.running = false; @@ -80,9 +81,9 @@ $.widget( "ui.tabs", { if ( active === null ) { // check the fragment identifier in the URL - if ( location.hash ) { - this.anchors.each(function( i, anchor ) { - if ( anchor.hash === location.hash ) { + if ( locationHash ) { + this.tabs.each(function( i, tab ) { + if ( $( tab ).attr( "aria-controls" ) === locationHash ) { active = i; return false; } @@ -91,7 +92,7 @@ $.widget( "ui.tabs", { // check for a tab marked active via a class if ( active === null ) { - active = this.tabs.filter( ".ui-tabs-active" ).index(); + active = this.tabs.index( this.tabs.filter( ".ui-tabs-active" ) ); } // no active tab, set to false diff --git a/ui/jquery.ui.tooltip.js b/ui/jquery.ui.tooltip.js index f38379f21..980b43868 100644 --- a/ui/jquery.ui.tooltip.js +++ b/ui/jquery.ui.tooltip.js @@ -140,6 +140,8 @@ $.widget( "ui.tooltip", { this._find( target ).position( $.extend({ of: target }, this.options.position ) ); + // Stop tracking (#8622) + this._off( this.document, "mousemove" ); return; } @@ -214,7 +216,7 @@ $.widget( "ui.tooltip", { positionOption.of = event; tooltip.position( positionOption ); } - if ( this.options.track && /^mouse/.test( event.originalEvent.type ) ) { + if ( this.options.track && event && /^mouse/.test( event.originalEvent.type ) ) { positionOption = $.extend( {}, this.options.position ); this._on( this.document, { mousemove: position @@ -315,8 +317,24 @@ $.widget( "ui.tooltip", { }, _destroy: function() { - $.each( this.tooltips, function( id ) { + var that = this; + + // close open tooltips + $.each( this.tooltips, function( id, element ) { + // Delegate to close method to handle common cleanup + var event = $.Event( "blur" ); + event.target = event.currentTarget = element[0]; + that.close( event, true ); + + // Remove immediately; destroying an open tooltip doesn't use the + // hide animation $( "#" + id ).remove(); + + // Restore the title + if ( element.data( "ui-tooltip-title" ) ) { + element.attr( "title", element.data( "ui-tooltip-title" ) ); + element.removeData( "ui-tooltip-title" ); + } }); } }); |