diff options
-rw-r--r-- | README.md | 32 | ||||
-rw-r--r-- | demos/autocomplete/images/jqueryui_32x32.png | bin | 1193 -> 1189 bytes | |||
-rw-r--r-- | demos/autocomplete/images/sizzlejs_32x32.png | bin | 999 -> 997 bytes | |||
-rw-r--r-- | demos/autocomplete/images/transparent_1x1.png | bin | 95 -> 81 bytes | |||
-rw-r--r-- | demos/datepicker/images/calendar.gif | bin | 269 -> 258 bytes | |||
-rw-r--r-- | demos/images/calendar.gif | bin | 269 -> 258 bytes | |||
-rw-r--r-- | demos/images/pbar-ani.gif | bin | 7970 -> 3404 bytes | |||
-rw-r--r-- | demos/position/cycler.html | 2 | ||||
-rw-r--r-- | demos/progressbar/images/pbar-ani.gif | bin | 7970 -> 3404 bytes | |||
-rw-r--r-- | package.json | 2 | ||||
-rw-r--r-- | tests/unit/datepicker/images/calendar.gif | bin | 269 -> 258 bytes | |||
-rw-r--r-- | tests/unit/dialog/dialog_common.js | 2 | ||||
-rw-r--r-- | tests/unit/dialog/dialog_options.js | 2 | ||||
-rw-r--r-- | tests/unit/draggable/draggable_core.js | 25 | ||||
-rw-r--r-- | tests/unit/testsuite.js | 2 | ||||
-rw-r--r-- | ui/jquery.ui.dialog.js | 2 | ||||
-rw-r--r-- | ui/jquery.ui.draggable.js | 38 |
17 files changed, 76 insertions, 31 deletions
@@ -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 diff --git a/demos/autocomplete/images/jqueryui_32x32.png b/demos/autocomplete/images/jqueryui_32x32.png Binary files differindex e003d16c1..27c18a49b 100644 --- a/demos/autocomplete/images/jqueryui_32x32.png +++ b/demos/autocomplete/images/jqueryui_32x32.png diff --git a/demos/autocomplete/images/sizzlejs_32x32.png b/demos/autocomplete/images/sizzlejs_32x32.png Binary files differindex 4ce0704d1..449def98f 100644 --- a/demos/autocomplete/images/sizzlejs_32x32.png +++ b/demos/autocomplete/images/sizzlejs_32x32.png diff --git a/demos/autocomplete/images/transparent_1x1.png b/demos/autocomplete/images/transparent_1x1.png Binary files differindex c2da5b889..c7ebb7480 100644 --- a/demos/autocomplete/images/transparent_1x1.png +++ b/demos/autocomplete/images/transparent_1x1.png diff --git a/demos/datepicker/images/calendar.gif b/demos/datepicker/images/calendar.gif Binary files differindex d0abaa7c0..52f2863c9 100644 --- a/demos/datepicker/images/calendar.gif +++ b/demos/datepicker/images/calendar.gif diff --git a/demos/images/calendar.gif b/demos/images/calendar.gif Binary files differindex d0abaa7c0..52f2863c9 100644 --- a/demos/images/calendar.gif +++ b/demos/images/calendar.gif diff --git a/demos/images/pbar-ani.gif b/demos/images/pbar-ani.gif Binary files differindex cb59a04f9..c22469afd 100644 --- a/demos/images/pbar-ani.gif +++ b/demos/images/pbar-ani.gif 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 ) { diff --git a/demos/progressbar/images/pbar-ani.gif b/demos/progressbar/images/pbar-ani.gif Binary files differindex cb59a04f9..c22469afd 100644 --- a/demos/progressbar/images/pbar-ani.gif +++ b/demos/progressbar/images/pbar-ani.gif 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", diff --git a/tests/unit/datepicker/images/calendar.gif b/tests/unit/datepicker/images/calendar.gif Binary files differindex d0abaa7c0..52f2863c9 100644 --- a/tests/unit/datepicker/images/calendar.gif +++ b/tests/unit/datepicker/images/calendar.gif 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 = $("<div></div>").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/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 = $( "<div>" ).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/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 ) { 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, diff --git a/ui/jquery.ui.draggable.js b/ui/jquery.ui.draggable.js index ab1e800cd..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 <iframe> + try { + // Support: IE9+ + // If the <body> is blurred, IE will switch windows, see #9520 + if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) { + // Blur any element that currently has focus, see #4261 + $( document.activeElement ).blur(); + } + } catch ( error ) {} // among others, prevent a drag on a resizable-handle if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) { @@ -452,7 +462,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 +479,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 +496,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 +562,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 ) ) ) }; |