Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/tasks/testswarm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var versions = {
"Menu": "menu/menu.html",
"Position": "position/position.html",
"Progressbar": "progressbar/progressbar.html",
//"Resizable": "resizable/resizable.html",
"Resizable": "resizable/resizable.html",
"Selectable": "selectable/selectable.html",
//"Slider": "slider/slider.html",
//"Sortable": "sortable/sortable.html",
Expand Down
4 changes: 2 additions & 2 deletions grunt.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,13 +281,13 @@ grunt.initConfig({
files: grunt.file.expandFiles( "tests/unit/**/*.html" ).filter(function( file ) {
// disabling everything that doesn't (quite) work with PhantomJS for now
// TODO except for all|index|test, try to include more as we go
return !( /(all|all-active|index|test|resizable|sortable|dialog|slider|datepicker|tabs|tooltip)\.html$/ ).test( file );
return !( /(all|all-active|index|test|sortable|dialog|slider|datepicker|tabs|tooltip)\.html$/ ).test( file );
})
},
lint: {
ui: grunt.file.expandFiles( "ui/*.js" ).filter(function( file ) {
// TODO remove items from this list once rewritten
return !( /(mouse|datepicker|resizable|sortable)\.js$/ ).test( file );
return !( /(mouse|datepicker|sortable)\.js$/ ).test( file );
}),
grunt: [ "grunt.js", "build/**/*.js" ],
tests: "tests/unit/**/*.js"
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/all-active.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"menu/menu.html",
"position/position.html",
"progressbar/progressbar.html",
//"resizable/resizable.html",
"resizable/resizable.html",
"selectable/selectable.html",
//"slider/slider.html",
//"sortable/sortable.html",
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"menu/menu.html",
"position/position.html",
"progressbar/progressbar.html",
//"resizable/resizable.html",
"resizable/resizable.html",
"selectable/selectable.html",
"slider/slider.html",
//"sortable/sortable.html",
Expand Down
52 changes: 27 additions & 25 deletions tests/unit/resizable/resizable_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,20 @@
* resizable_core.js
*/

TestHelpers.resizableDrag = function(el, dx, dy, complete) {
TestHelpers.resizable = {
drag: function(el, dx, dy, complete) {

// speed = sync -> Drag syncrhonously.
// speed = fast|slow -> Drag asyncrhonously - animated.
// speed = sync -> Drag syncrhonously.
// speed = fast|slow -> Drag asyncrhonously - animated.

//this mouseover is to work around a limitation in resizable
//TODO: fix resizable so handle doesn't require mouseover in order to be used
$(el).simulate("mouseover");
//this mouseover is to work around a limitation in resizable
//TODO: fix resizable so handle doesn't require mouseover in order to be used
$(el).simulate("mouseover");

return $(el).simulate("drag", {
dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
});
return $(el).simulate("drag", {
dx: dx||0, dy: dy||0, speed: 'sync', complete: complete
});
}
};

(function($) {
Expand Down Expand Up @@ -44,10 +46,10 @@ test("n", function() {

var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, 0, -50);
TestHelpers.resizable.drag(handle, 0, -50);
equal( target.height(), 150, "compare height" );

TestHelpers.resizableDrag(handle, 0, 50);
TestHelpers.resizable.drag(handle, 0, 50);
equal( target.height(), 100, "compare height" );
});

Expand All @@ -56,10 +58,10 @@ test("s", function() {

var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, 0, 50);
TestHelpers.resizable.drag(handle, 0, 50);
equal( target.height(), 150, "compare height" );

TestHelpers.resizableDrag(handle, 0, -50);
TestHelpers.resizable.drag(handle, 0, -50);
equal( target.height(), 100, "compare height" );
});

Expand All @@ -68,10 +70,10 @@ test("e", function() {

var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, 50);
TestHelpers.resizable.drag(handle, 50);
equal( target.width(), 150, "compare width");

TestHelpers.resizableDrag(handle, -50);
TestHelpers.resizable.drag(handle, -50);
equal( target.width(), 100, "compare width" );
});

Expand All @@ -80,10 +82,10 @@ test("w", function() {

var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, -50);
TestHelpers.resizable.drag(handle, -50);
equal( target.width(), 150, "compare width" );

TestHelpers.resizableDrag(handle, 50);
TestHelpers.resizable.drag(handle, 50);
equal( target.width(), 100, "compare width" );
});

Expand All @@ -92,11 +94,11 @@ test("ne", function() {

var handle = '.ui-resizable-ne', target = $('#resizable1').css({ overflow: 'hidden' }).resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, -50, -50);
TestHelpers.resizable.drag(handle, -50, -50);
equal( target.width(), 50, "compare width" );
equal( target.height(), 150, "compare height" );

TestHelpers.resizableDrag(handle, 50, 50);
TestHelpers.resizable.drag(handle, 50, 50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
Expand All @@ -106,11 +108,11 @@ test("se", function() {

var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, 50, 50);
TestHelpers.resizable.drag(handle, 50, 50);
equal( target.width(), 150, "compare width" );
equal( target.height(), 150, "compare height" );

TestHelpers.resizableDrag(handle, -50, -50);
TestHelpers.resizable.drag(handle, -50, -50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
Expand All @@ -120,11 +122,11 @@ test("sw", function() {

var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, -50, -50);
TestHelpers.resizable.drag(handle, -50, -50);
equal( target.width(), 150, "compare width" );
equal( target.height(), 50, "compare height" );

TestHelpers.resizableDrag(handle, 50, 50);
TestHelpers.resizable.drag(handle, 50, 50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
Expand All @@ -134,11 +136,11 @@ test("nw", function() {

var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all' });

TestHelpers.resizableDrag(handle, -50, -50);
TestHelpers.resizable.drag(handle, -50, -50);
equal( target.width(), 150, "compare width" );
equal( target.height(), 150, "compare height" );

TestHelpers.resizableDrag(handle, 50, 50);
TestHelpers.resizable.drag(handle, 50, 50);
equal( target.width(), 100, "compare width" );
equal( target.height(), 100, "compare height" );
});
Expand Down
52 changes: 26 additions & 26 deletions tests/unit/resizable/resizable_options.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ test("aspectRatio: 'preserve' (e)", function() {

var handle = '.ui-resizable-e', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });

TestHelpers.resizableDrag(handle, 80);
TestHelpers.resizable.drag(handle, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");

TestHelpers.resizableDrag(handle, -130);
TestHelpers.resizable.drag(handle, -130);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
Expand All @@ -24,11 +24,11 @@ test("aspectRatio: 'preserve' (w)", function() {

var handle = '.ui-resizable-w', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });

TestHelpers.resizableDrag(handle, -80);
TestHelpers.resizable.drag(handle, -80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");

TestHelpers.resizableDrag(handle, 130);
TestHelpers.resizable.drag(handle, 130);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
Expand All @@ -38,11 +38,11 @@ test("aspectRatio: 'preserve' (n)", function() {

var handle = '.ui-resizable-n', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });

TestHelpers.resizableDrag(handle, 0, -80);
TestHelpers.resizable.drag(handle, 0, -80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");

TestHelpers.resizableDrag(handle, 0, 80);
TestHelpers.resizable.drag(handle, 0, 80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
Expand All @@ -52,11 +52,11 @@ test("aspectRatio: 'preserve' (s)", function() {

var handle = '.ui-resizable-s', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });

TestHelpers.resizableDrag(handle, 0, 80);
TestHelpers.resizable.drag(handle, 0, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");

TestHelpers.resizableDrag(handle, 0, -80);
TestHelpers.resizable.drag(handle, 0, -80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
Expand All @@ -66,11 +66,11 @@ test("aspectRatio: 'preserve' (se)", function() {

var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });

TestHelpers.resizableDrag(handle, 80, 80);
TestHelpers.resizable.drag(handle, 80, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");

TestHelpers.resizableDrag(handle, -80, -80);
TestHelpers.resizable.drag(handle, -80, -80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
Expand All @@ -80,11 +80,11 @@ test("aspectRatio: 'preserve' (sw)", function() {

var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });

TestHelpers.resizableDrag(handle, -80, 80);
TestHelpers.resizable.drag(handle, -80, 80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");

TestHelpers.resizableDrag(handle, 80, -80);
TestHelpers.resizable.drag(handle, 80, -80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
Expand All @@ -94,11 +94,11 @@ test("aspectRatio: 'preserve' (ne)", function() {

var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ aspectRatio: 'preserve', handles: 'all', minWidth: 70, minHeight: 50, maxWidth: 150, maxHeight: 130 });

TestHelpers.resizableDrag(handle, 80, -80);
TestHelpers.resizable.drag(handle, 80, -80);
equal( target.width(), 130, "compare maxWidth");
equal( target.height(), 130, "compare maxHeight");

TestHelpers.resizableDrag(handle, -80, 80);
TestHelpers.resizable.drag(handle, -80, 80);
equal( target.width(), 70, "compare minWidth");
equal( target.height(), 70, "compare minHeight");
});
Expand All @@ -108,11 +108,11 @@ test("grid", function() {

var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', grid: [0, 20] });

TestHelpers.resizableDrag(handle, 3, 9);
TestHelpers.resizable.drag(handle, 3, 9);
equal( target.width(), 103, "compare width");
equal( target.height(), 100, "compare height");

TestHelpers.resizableDrag(handle, 15, 11);
TestHelpers.resizable.drag(handle, 15, 11);
equal( target.width(), 118, "compare width");
equal( target.height(), 120, "compare height");
});
Expand All @@ -122,11 +122,11 @@ test("grid (wrapped)", function() {

var handle = '.ui-resizable-se', target = $('#resizable2').resizable({ handles: 'all', grid: [0, 20] });

TestHelpers.resizableDrag(handle, 3, 9);
TestHelpers.resizable.drag(handle, 3, 9);
equal( target.width(), 103, "compare width");
equal( target.height(), 100, "compare height");

TestHelpers.resizableDrag(handle, 15, 11);
TestHelpers.resizable.drag(handle, 15, 11);
equal( target.width(), 118, "compare width");
equal( target.height(), 120, "compare height");
});
Expand All @@ -136,11 +136,11 @@ test("ui-resizable-se { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1

var handle = '.ui-resizable-se', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });

TestHelpers.resizableDrag(handle, -50, -50);
TestHelpers.resizable.drag(handle, -50, -50);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );

TestHelpers.resizableDrag(handle, 70, 70);
TestHelpers.resizable.drag(handle, 70, 70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});
Expand All @@ -150,11 +150,11 @@ test("ui-resizable-sw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1

var handle = '.ui-resizable-sw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });

TestHelpers.resizableDrag(handle, 50, -50);
TestHelpers.resizable.drag(handle, 50, -50);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );

TestHelpers.resizableDrag(handle, -70, 70);
TestHelpers.resizable.drag(handle, -70, 70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});
Expand All @@ -164,11 +164,11 @@ test("ui-resizable-ne { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1

var handle = '.ui-resizable-ne', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });

TestHelpers.resizableDrag(handle, -50, 50);
TestHelpers.resizable.drag(handle, -50, 50);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );

TestHelpers.resizableDrag(handle, 70, -70);
TestHelpers.resizable.drag(handle, 70, -70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});
Expand All @@ -178,11 +178,11 @@ test("ui-resizable-nw { handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 1

var handle = '.ui-resizable-nw', target = $('#resizable1').resizable({ handles: 'all', minWidth: 60, minHeight: 60, maxWidth: 100, maxHeight: 100 });

TestHelpers.resizableDrag(handle, 70, 70);
TestHelpers.resizable.drag(handle, 70, 70);
equal( target.width(), 60, "compare minWidth" );
equal( target.height(), 60, "compare minHeight" );

TestHelpers.resizableDrag(handle, -70, -70);
TestHelpers.resizable.drag(handle, -70, -70);
equal( target.width(), 100, "compare maxWidth" );
equal( target.height(), 100, "compare maxHeight" );
});
Expand Down
2 changes: 0 additions & 2 deletions ui/jquery.ui.droppable.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
* jquery.ui.mouse.js
* jquery.ui.draggable.js
*/


(function( $, undefined ) {

/*jshint onevar: false, curly: false, eqeqeq: false, laxbreak: true */
Expand Down
Loading