From 1c58573a95778010c247605ebb1915d8e8739423 Mon Sep 17 00:00:00 2001 From: Mohsen Ekhtiari Date: Mon, 12 Aug 2013 02:15:33 +0430 Subject: Position demo: Added missing semicolon. --- demos/position/cycler.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demos/position/cycler.html b/demos/position/cycler.html index b66ca6aaf..e33e3be91 100644 --- a/demos/position/cycler.html +++ b/demos/position/cycler.html @@ -63,7 +63,7 @@ function next( event ) { event.preventDefault(); $( "img:eq(2)" ).center( animate ); - $( "img:eq(1)" ).left( animate ) + $( "img:eq(1)" ).left( animate ); $( "img:eq(0)" ).right().appendTo( "#container" ); } function previous( event ) { -- cgit v1.2.3 From 263d07894493aafcdc6a565f9f9c079b4b8f5d80 Mon Sep 17 00:00:00 2001 From: Mike Sherov Date: Mon, 12 Aug 2013 19:31:39 -0400 Subject: Draggable: Ignore scroll offsets for abspos draggables. Fixes #9315 - Draggable: jumps down with offset of scrollbar --- tests/unit/draggable/draggable_core.js | 25 +++++++++++++++++++++++++ ui/jquery.ui.draggable.js | 22 ++++++++++++++++------ 2 files changed, 41 insertions(+), 6 deletions(-) diff --git a/tests/unit/draggable/draggable_core.js b/tests/unit/draggable/draggable_core.js index 69906b6a7..0389ea9ee 100644 --- a/tests/unit/draggable/draggable_core.js +++ b/tests/unit/draggable/draggable_core.js @@ -139,6 +139,31 @@ test( "#6258: not following mouse when scrolled and using overflow-y: scroll", f }); }); +test( "#9315: Draggable: jumps down with offset of scrollbar", function() { + expect( 2 ); + + var element = $( "#draggable2" ).draggable({ + stop: function( event, ui ) { + equal( ui.position.left, 11, "left position is correct when position is absolute" ); + equal( ui.position.top, 11, "top position is correct when position is absolute" ); + $( "html" ).scrollTop( 0 ).scrollLeft( 0 ); + } + }), + contentToForceScroll = $( "
" ).css({ + height: "10000px", + width: "10000px" + }); + + contentToForceScroll.appendTo( "#qunit-fixture" ); + $( "html" ).scrollTop( 300 ).scrollLeft( 300 ); + + element.simulate( "drag", { + dx: 1, + dy: 1, + moves: 1 + }); +}); + test( "#5009: scroll not working with parent's position fixed", function() { expect( 2 ); diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index ab1e800cd..2bdc20255 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -452,7 +452,12 @@ $.widget("ui.draggable", $.ui.mouse, { var mod = d === "absolute" ? 1 : -1, document = this.document[ 0 ], - scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent; + useOffsetParent = this.cssPosition === "absolute" && ( this.scrollParent[ 0 ] === document || !$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ), + scroll = useOffsetParent ? this.offsetParent : this.scrollParent, + // we need to test if offsetParent was used here because Blink incorrectly reports a 0 scrollTop + // on document.documentElement when the page is scrolled. Checking for offsetParent normalizes + // this across browsers. Blink bug: https://code.google.com/p/chromium/issues/detail?id=157855 + scrollIsRootNode = useOffsetParent && ( /(html|body)/i ).test( scroll[ 0 ].nodeName ); //Cache the scroll if (!this.offset.scroll) { @@ -464,13 +469,13 @@ $.widget("ui.draggable", $.ui.mouse, { pos.top + // The absolute mouse position this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border) - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) * mod ) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod) ), left: ( pos.left + // The absolute mouse position this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border) - ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) * mod ) + ( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : this.offset.scroll.left ) * mod) ) }; @@ -481,7 +486,12 @@ $.widget("ui.draggable", $.ui.mouse, { var containment, co, top, left, o = this.options, document = this.document[ 0 ], - scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent, + useOffsetParent = this.cssPosition === "absolute" && ( this.scrollParent[ 0 ] === document || !$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ), + scroll = useOffsetParent ? this.offsetParent : this.scrollParent, + // we need to test if offsetParent was used here because Blink incorrectly reports a 0 scrollTop + // on document.documentElement when the page is scrolled. Checking for offsetParent normalizes + // this across browsers. Blink bug: https://code.google.com/p/chromium/issues/detail?id=157855 + scrollIsRootNode = useOffsetParent && ( /(html|body)/i ).test( scroll[ 0 ].nodeName ), pageX = event.pageX, pageY = event.pageY; @@ -542,14 +552,14 @@ $.widget("ui.draggable", $.ui.mouse, { this.offset.click.top - // Click offset (relative to the element) this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.parent.top + // The offsetParent's offset without borders (offset + border) - ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) + ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) ), left: ( pageX - // The absolute mouse position this.offset.click.left - // Click offset (relative to the element) this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent this.offset.parent.left + // The offsetParent's offset without borders (offset + border) - ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) + ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) ) ) }; -- cgit v1.2.3 From e628d0e4ba89eecee2c9b0d4cfb214523cad2ab4 Mon Sep 17 00:00:00 2001 From: Scott González Date: Thu, 15 Aug 2013 16:56:49 -0400 Subject: Dialog: Capitalize default value for closeText option. Fixes #9500 - Dialog: Capitalize 'close' for closeText option. --- tests/unit/dialog/dialog_common.js | 2 +- tests/unit/dialog/dialog_options.js | 2 +- ui/jquery.ui.dialog.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/unit/dialog/dialog_common.js b/tests/unit/dialog/dialog_common.js index ea4c91767..fc10fabaa 100644 --- a/tests/unit/dialog/dialog_common.js +++ b/tests/unit/dialog/dialog_common.js @@ -4,7 +4,7 @@ TestHelpers.commonWidgetTests( "dialog", { autoOpen: true, buttons: [], closeOnEscape: true, - closeText: "close", + closeText: "Close", disabled: false, dialogClass: "", draggable: true, diff --git a/tests/unit/dialog/dialog_options.js b/tests/unit/dialog/dialog_options.js index 07c2d6860..66aeebde0 100644 --- a/tests/unit/dialog/dialog_options.js +++ b/tests/unit/dialog/dialog_options.js @@ -209,7 +209,7 @@ test("closeText", function() { expect(3); var element = $("
").dialog(); - equal(element.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "close", + equal(element.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "Close", "default close text"); element.remove(); diff --git a/ui/jquery.ui.dialog.js b/ui/jquery.ui.dialog.js index 4279d357c..0170a42d2 100644 --- a/ui/jquery.ui.dialog.js +++ b/ui/jquery.ui.dialog.js @@ -42,7 +42,7 @@ $.widget( "ui.dialog", { autoOpen: true, buttons: [], closeOnEscape: true, - closeText: "close", + closeText: "Close", dialogClass: "", draggable: true, hide: null, -- cgit v1.2.3 From dc380ee6955393d4bc3bbc334cc6724cefa5b48c Mon Sep 17 00:00:00 2001 From: Scott González Date: Wed, 21 Aug 2013 09:37:03 -0400 Subject: Tests: Fixed accidental use of comma instead of semicolon. --- tests/unit/testsuite.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/testsuite.js b/tests/unit/testsuite.js index 6e840f415..cef24e93b 100644 --- a/tests/unit/testsuite.js +++ b/tests/unit/testsuite.js @@ -83,7 +83,7 @@ TestHelpers.testJshint = function( module ) { globals = jshintrc.globals || {}; delete jshintrc.globals; - passed = JSHINT( source, jshintrc, globals ), + passed = JSHINT( source, jshintrc, globals ); errors = $.map( JSHINT.errors, function( error ) { // JSHINT may report null if there are too many errors if ( !error ) { -- cgit v1.2.3 From 441b7fc8c1e7651a84ebcd182f6b9e3b3a088fd0 Mon Sep 17 00:00:00 2001 From: Pere Orga Date: Mon, 26 Aug 2013 14:38:32 +0100 Subject: Demos/tests: Losslessly recompress PNG/GIF images. --- demos/autocomplete/images/jqueryui_32x32.png | Bin 1193 -> 1189 bytes demos/autocomplete/images/sizzlejs_32x32.png | Bin 999 -> 997 bytes demos/autocomplete/images/transparent_1x1.png | Bin 95 -> 81 bytes demos/datepicker/images/calendar.gif | Bin 269 -> 258 bytes demos/images/calendar.gif | Bin 269 -> 258 bytes demos/images/pbar-ani.gif | Bin 7970 -> 3404 bytes demos/progressbar/images/pbar-ani.gif | Bin 7970 -> 3404 bytes tests/unit/datepicker/images/calendar.gif | Bin 269 -> 258 bytes 8 files changed, 0 insertions(+), 0 deletions(-) diff --git a/demos/autocomplete/images/jqueryui_32x32.png b/demos/autocomplete/images/jqueryui_32x32.png index e003d16c1..27c18a49b 100644 Binary files a/demos/autocomplete/images/jqueryui_32x32.png and b/demos/autocomplete/images/jqueryui_32x32.png differ diff --git a/demos/autocomplete/images/sizzlejs_32x32.png b/demos/autocomplete/images/sizzlejs_32x32.png index 4ce0704d1..449def98f 100644 Binary files a/demos/autocomplete/images/sizzlejs_32x32.png and b/demos/autocomplete/images/sizzlejs_32x32.png differ diff --git a/demos/autocomplete/images/transparent_1x1.png b/demos/autocomplete/images/transparent_1x1.png index c2da5b889..c7ebb7480 100644 Binary files a/demos/autocomplete/images/transparent_1x1.png and b/demos/autocomplete/images/transparent_1x1.png differ diff --git a/demos/datepicker/images/calendar.gif b/demos/datepicker/images/calendar.gif index d0abaa7c0..52f2863c9 100644 Binary files a/demos/datepicker/images/calendar.gif and b/demos/datepicker/images/calendar.gif differ diff --git a/demos/images/calendar.gif b/demos/images/calendar.gif index d0abaa7c0..52f2863c9 100644 Binary files a/demos/images/calendar.gif and b/demos/images/calendar.gif differ diff --git a/demos/images/pbar-ani.gif b/demos/images/pbar-ani.gif index cb59a04f9..c22469afd 100644 Binary files a/demos/images/pbar-ani.gif and b/demos/images/pbar-ani.gif differ diff --git a/demos/progressbar/images/pbar-ani.gif b/demos/progressbar/images/pbar-ani.gif index cb59a04f9..c22469afd 100644 Binary files a/demos/progressbar/images/pbar-ani.gif and b/demos/progressbar/images/pbar-ani.gif differ diff --git a/tests/unit/datepicker/images/calendar.gif b/tests/unit/datepicker/images/calendar.gif index d0abaa7c0..52f2863c9 100644 Binary files a/tests/unit/datepicker/images/calendar.gif and b/tests/unit/datepicker/images/calendar.gif differ -- cgit v1.2.3 From cca2daafec0817e423aec39a251e6eacdd4d611b Mon Sep 17 00:00:00 2001 From: Scott González Date: Tue, 27 Aug 2013 13:00:56 -0400 Subject: README: Updated build instructions. --- README.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 33b3907a5..d02a93936 100644 --- a/README.md +++ b/README.md @@ -36,29 +36,29 @@ Run the unit tests with a local server that supports PHP. No database is require Building jQuery UI --- -jQuery UI uses the [grunt](http://github.com/cowboy/grunt) build system. Building jQuery UI requires node.js and a command line zip program. +jQuery UI uses the [Grunt](http://github.com/gruntjs/grunt) build system. -Install grunt. +To build jQuery UI, you must have [node.js](http://nodejs.org/) installed and then run the following commands: -`npm install grunt -g` +```sh -Clone the jQuery UI git repo. +# Install the Grunt CLI +npm install -g grunt-cli -`git clone git://github.com/jquery/jquery-ui.git` +# Clone the jQuery UI git repo +git clone git://github.com/jquery/jquery-ui.git +cd jquery-ui -`cd jquery-ui` +# Install the node module dependencies +npm install -Install node modules. +# Run the build task +grunt build -`npm install` - -Run grunt. - -`grunt build` - -There are many other tasks that can be run through grunt. For a list of all tasks: - -`grunt --help` +# There are many other tasks that can be run through Grunt. +# For a list of all tasks: +grunt --help +``` For committers -- cgit v1.2.3 From 643ef44ee2ed4fa5176ad76d69f855b0d97486cc Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Wed, 28 Aug 2013 09:22:26 -0400 Subject: Upgrade grunt-contrib-jshint to 0.6.3. --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b561295b1..4a9316612 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "dependencies": {}, "devDependencies": { "grunt": "0.4.1", - "grunt-contrib-jshint": "0.6.0", + "grunt-contrib-jshint": "0.6.3", "grunt-contrib-uglify": "0.1.1", "grunt-contrib-concat": "0.1.3", "grunt-contrib-qunit": "0.2.0", -- cgit v1.2.3 From eae2c4b358af3ebfae258abfe77eeace48fcefcb Mon Sep 17 00:00:00 2001 From: TJ VanToll Date: Wed, 28 Aug 2013 09:17:01 -0400 Subject: Draggable: Safe activeElement access from iFrames for IE9, prevent window focus changes in IE9+. Fixed #9520 - Draggable: Browser window drops behind other windows in IE9/10 --- ui/jquery.ui.draggable.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index 2bdc20255..3b18f28f0 100644 --- a/ui/jquery.ui.draggable.js +++ b/ui/jquery.ui.draggable.js @@ -76,9 +76,19 @@ $.widget("ui.draggable", $.ui.mouse, { _mouseCapture: function(event) { - var o = this.options; - - $( document.activeElement ).blur(); + var document = this.document[ 0 ], + o = this.options; + + // support: IE9 + // IE9 throws an "Unspecified error" accessing document.activeElement from an