Merge branch 'master' into selectmenu

This commit is contained in:
Felix Nagel 2013-08-31 03:12:22 +02:00
commit cf6dbd8b6b
17 changed files with 75 additions and 30 deletions

View File

@ -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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 999 B

After

Width:  |  Height:  |  Size: 997 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 B

After

Width:  |  Height:  |  Size: 81 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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 ) {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -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",

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 B

After

Width:  |  Height:  |  Size: 258 B

View File

@ -4,7 +4,7 @@ TestHelpers.commonWidgetTests( "dialog", {
autoOpen: true,
buttons: [],
closeOnEscape: true,
closeText: "close",
closeText: "Close",
disabled: false,
dialogClass: "",
draggable: true,

View File

@ -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();

View File

@ -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 );

View File

@ -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 ) {

View File

@ -42,7 +42,7 @@ $.widget( "ui.dialog", {
autoOpen: true,
buttons: [],
closeOnEscape: true,
closeText: "close",
closeText: "Close",
dialogClass: "",
draggable: true,
hide: null,

View File

@ -76,9 +76,19 @@ $.widget("ui.draggable", $.ui.mouse, {
_mouseCapture: function(event) {
var o = this.options;
var document = this.document[ 0 ],
o = this.options;
$( document.activeElement ).blur();
// 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 ) )
)
};