Skip to content

Commit cf6dbd8

Browse files
committed
Merge branch 'master' into selectmenu
2 parents d668c94 + eae2c4b commit cf6dbd8

File tree

17 files changed

+76
-31
lines changed

17 files changed

+76
-31
lines changed

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,29 @@ Run the unit tests with a local server that supports PHP. No database is require
3636
Building jQuery UI
3737
---
3838

39-
jQuery UI uses the [grunt](http://github.com/cowboy/grunt) build system. Building jQuery UI requires node.js and a command line zip program.
39+
jQuery UI uses the [Grunt](http://github.com/gruntjs/grunt) build system.
4040

41-
Install grunt.
41+
To build jQuery UI, you must have [node.js](http://nodejs.org/) installed and then run the following commands:
4242

43-
`npm install grunt -g`
43+
```sh
4444

45-
Clone the jQuery UI git repo.
45+
# Install the Grunt CLI
46+
npm install -g grunt-cli
4647

47-
`git clone git://github.com/jquery/jquery-ui.git`
48+
# Clone the jQuery UI git repo
49+
git clone git://github.com/jquery/jquery-ui.git
50+
cd jquery-ui
4851

49-
`cd jquery-ui`
52+
# Install the node module dependencies
53+
npm install
5054

51-
Install node modules.
55+
# Run the build task
56+
grunt build
5257

53-
`npm install`
54-
55-
Run grunt.
56-
57-
`grunt build`
58-
59-
There are many other tasks that can be run through grunt. For a list of all tasks:
60-
61-
`grunt --help`
58+
# There are many other tasks that can be run through Grunt.
59+
# For a list of all tasks:
60+
grunt --help
61+
```
6262

6363

6464
For committers
-4 Bytes
Loading
-2 Bytes
Loading
-14 Bytes
Loading

demos/datepicker/images/calendar.gif

-11 Bytes
Loading

demos/images/calendar.gif

-11 Bytes
Loading

demos/images/pbar-ani.gif

-4.46 KB
Loading

demos/position/cycler.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
function next( event ) {
6464
event.preventDefault();
6565
$( "img:eq(2)" ).center( animate );
66-
$( "img:eq(1)" ).left( animate )
66+
$( "img:eq(1)" ).left( animate );
6767
$( "img:eq(0)" ).right().appendTo( "#container" );
6868
}
6969
function previous( event ) {

demos/progressbar/images/pbar-ani.gif

-4.46 KB
Loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
"dependencies": {},
5858
"devDependencies": {
5959
"grunt": "0.4.1",
60-
"grunt-contrib-jshint": "0.6.0",
60+
"grunt-contrib-jshint": "0.6.3",
6161
"grunt-contrib-uglify": "0.1.1",
6262
"grunt-contrib-concat": "0.1.3",
6363
"grunt-contrib-qunit": "0.2.0",
-11 Bytes
Loading

tests/unit/dialog/dialog_common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ TestHelpers.commonWidgetTests( "dialog", {
44
autoOpen: true,
55
buttons: [],
66
closeOnEscape: true,
7-
closeText: "close",
7+
closeText: "Close",
88
disabled: false,
99
dialogClass: "",
1010
draggable: true,

tests/unit/dialog/dialog_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ test("closeText", function() {
209209
expect(3);
210210

211211
var element = $("<div></div>").dialog();
212-
equal(element.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "close",
212+
equal(element.dialog("widget").find(".ui-dialog-titlebar-close span").text(), "Close",
213213
"default close text");
214214
element.remove();
215215

tests/unit/draggable/draggable_core.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,31 @@ test( "#6258: not following mouse when scrolled and using overflow-y: scroll", f
139139
});
140140
});
141141

142+
test( "#9315: Draggable: jumps down with offset of scrollbar", function() {
143+
expect( 2 );
144+
145+
var element = $( "#draggable2" ).draggable({
146+
stop: function( event, ui ) {
147+
equal( ui.position.left, 11, "left position is correct when position is absolute" );
148+
equal( ui.position.top, 11, "top position is correct when position is absolute" );
149+
$( "html" ).scrollTop( 0 ).scrollLeft( 0 );
150+
}
151+
}),
152+
contentToForceScroll = $( "<div>" ).css({
153+
height: "10000px",
154+
width: "10000px"
155+
});
156+
157+
contentToForceScroll.appendTo( "#qunit-fixture" );
158+
$( "html" ).scrollTop( 300 ).scrollLeft( 300 );
159+
160+
element.simulate( "drag", {
161+
dx: 1,
162+
dy: 1,
163+
moves: 1
164+
});
165+
});
166+
142167
test( "#5009: scroll not working with parent's position fixed", function() {
143168
expect( 2 );
144169

tests/unit/testsuite.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ TestHelpers.testJshint = function( module ) {
8383

8484
globals = jshintrc.globals || {};
8585
delete jshintrc.globals;
86-
passed = JSHINT( source, jshintrc, globals ),
86+
passed = JSHINT( source, jshintrc, globals );
8787
errors = $.map( JSHINT.errors, function( error ) {
8888
// JSHINT may report null if there are too many errors
8989
if ( !error ) {

ui/jquery.ui.dialog.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ $.widget( "ui.dialog", {
4242
autoOpen: true,
4343
buttons: [],
4444
closeOnEscape: true,
45-
closeText: "close",
45+
closeText: "Close",
4646
dialogClass: "",
4747
draggable: true,
4848
hide: null,

ui/jquery.ui.draggable.js

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,19 @@ $.widget("ui.draggable", $.ui.mouse, {
7676

7777
_mouseCapture: function(event) {
7878

79-
var o = this.options;
80-
81-
$( document.activeElement ).blur();
79+
var document = this.document[ 0 ],
80+
o = this.options;
81+
82+
// support: IE9
83+
// IE9 throws an "Unspecified error" accessing document.activeElement from an <iframe>
84+
try {
85+
// Support: IE9+
86+
// If the <body> is blurred, IE will switch windows, see #9520
87+
if ( document.activeElement && document.activeElement.nodeName.toLowerCase() !== "body" ) {
88+
// Blur any element that currently has focus, see #4261
89+
$( document.activeElement ).blur();
90+
}
91+
} catch ( error ) {}
8292

8393
// among others, prevent a drag on a resizable-handle
8494
if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
@@ -452,7 +462,12 @@ $.widget("ui.draggable", $.ui.mouse, {
452462

453463
var mod = d === "absolute" ? 1 : -1,
454464
document = this.document[ 0 ],
455-
scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent;
465+
useOffsetParent = this.cssPosition === "absolute" && ( this.scrollParent[ 0 ] === document || !$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ),
466+
scroll = useOffsetParent ? this.offsetParent : this.scrollParent,
467+
// we need to test if offsetParent was used here because Blink incorrectly reports a 0 scrollTop
468+
// on document.documentElement when the page is scrolled. Checking for offsetParent normalizes
469+
// this across browsers. Blink bug: https://code.google.com/p/chromium/issues/detail?id=157855
470+
scrollIsRootNode = useOffsetParent && ( /(html|body)/i ).test( scroll[ 0 ].nodeName );
456471

457472
//Cache the scroll
458473
if (!this.offset.scroll) {
@@ -464,13 +479,13 @@ $.widget("ui.draggable", $.ui.mouse, {
464479
pos.top + // The absolute mouse position
465480
this.offset.relative.top * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
466481
this.offset.parent.top * mod - // The offsetParent's offset without borders (offset + border)
467-
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) * mod )
482+
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) ) * mod)
468483
),
469484
left: (
470485
pos.left + // The absolute mouse position
471486
this.offset.relative.left * mod + // Only for relative positioned nodes: Relative offset from element to offset parent
472487
this.offset.parent.left * mod - // The offsetParent's offset without borders (offset + border)
473-
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) * mod )
488+
( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : this.offset.scroll.left ) * mod)
474489
)
475490
};
476491

@@ -481,7 +496,12 @@ $.widget("ui.draggable", $.ui.mouse, {
481496
var containment, co, top, left,
482497
o = this.options,
483498
document = this.document[ 0 ],
484-
scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
499+
useOffsetParent = this.cssPosition === "absolute" && ( this.scrollParent[ 0 ] === document || !$.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ),
500+
scroll = useOffsetParent ? this.offsetParent : this.scrollParent,
501+
// we need to test if offsetParent was used here because Blink incorrectly reports a 0 scrollTop
502+
// on document.documentElement when the page is scrolled. Checking for offsetParent normalizes
503+
// this across browsers. Blink bug: https://code.google.com/p/chromium/issues/detail?id=157855
504+
scrollIsRootNode = useOffsetParent && ( /(html|body)/i ).test( scroll[ 0 ].nodeName ),
485505
pageX = event.pageX,
486506
pageY = event.pageY;
487507

@@ -542,14 +562,14 @@ $.widget("ui.draggable", $.ui.mouse, {
542562
this.offset.click.top - // Click offset (relative to the element)
543563
this.offset.relative.top - // Only for relative positioned nodes: Relative offset from element to offset parent
544564
this.offset.parent.top + // The offsetParent's offset without borders (offset + border)
545-
( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top )
565+
( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : this.offset.scroll.top ) )
546566
),
547567
left: (
548568
pageX - // The absolute mouse position
549569
this.offset.click.left - // Click offset (relative to the element)
550570
this.offset.relative.left - // Only for relative positioned nodes: Relative offset from element to offset parent
551571
this.offset.parent.left + // The offsetParent's offset without borders (offset + border)
552-
( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left )
572+
( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : ( scrollIsRootNode ? 0 : this.offset.scroll.left ) )
553573
)
554574
};
555575

0 commit comments

Comments
 (0)