"core/core.html",
"datepicker/datepicker.html",
"dialog/dialog.html",
- //"draggable/draggable.html",
- //"droppable/droppable.html",
+ "draggable/draggable.html",
+ "droppable/droppable.html",
"position/position.html",
"progressbar/progressbar.html",
- //"resizable/resizable.html",
- //"selectable/selectable.html",
+ "resizable/resizable.html",
+ "selectable/selectable.html",
"slider/slider.html",
- //"sortable/sortable.html",
+ "sortable/sortable.html",
"tabs/tabs.html",
"widget/widget.html"
]);
module("draggable");
-test("element types", function() {
- var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
- + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
- + ',acronym,code,samp,kbd,var,img,object,hr'
- + ',input,button,label,select,iframe').split(',');
-
- $.each(typeNames, function(i) {
- var typeName = typeNames[i];
- el = $(document.createElement(typeName)).appendTo('body');
- (typeName == 'table' && el.append("<tr><td>content</td></tr>"));
- el.draggable({ cancel: '' });
- drag(el, 50, 50);
- moved(50, 50, "<" + typeName + ">");
- el.draggable("destroy");
- el.remove();
- });
-});
-
-test("No options, relative", function() {
- el = $("#draggable1").draggable();
- drag(el, 50, 50);
- moved(50, 50);
-});
-
-test("No options, absolute", function() {
- el = $("#draggable2").draggable();
- drag(el, 50, 50);
- moved(50, 50);
-});
-
})(jQuery);
})
});
-test("{ cancel: ':input,option' }, default", function() {
- equals(draggable_defaults.cancel, ":input,option");
-
- $('<div id="draggable-option-cancel-default"><input type="text"></div>').appendTo('#main');
-
- el = $("#draggable-option-cancel-default").draggable({ cancel: ":input,option" });
- drag("#draggable-option-cancel-default", 50, 50);
- moved(50, 50);
-
- el = $("#draggable-option-cancel-default").draggable({ cancel: ":input,option" });
- drag("#draggable-option-cancel-default :input", 50, 50);
- moved(0, 0);
-
- el.draggable("destroy");
-});
-
test("{ cancel: 'span' }", function() {
el = $("#draggable2").draggable();
drag("#draggable2 span", 50, 50);
})
});
-test("{ containment: false }, default", function() {
- equals(draggable_defaults.containment, false);
-
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("{ containment: Element }", function() {
- ok(false, 'missing test - untested code is broken code');
-});
test("{ containment: 'parent' }, relative", function() {
el = $("#draggable1").draggable({ containment: 'parent' });
same(offsetAfter, expected, 'compare offset to parent');
});
-test("{ containment: 'document' }", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("{ containment: 'window' }", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("{ containment: Selector }", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("{ containment: [x1, y1, x2, y2] }", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
test("{ cursor: 'auto' }, default", function() {
equals(draggable_defaults.cursor, 'auto');
});
-test("{ cursorAt: false}, default", function() {
- equals(draggable_defaults.cursorAt, false);
-
- ok(false, 'missing test - untested code is broken code');
-});
-
test("{ cursorAt: { left: -5, top: -5 } }", function() {
expect(4);
moved(0, 0, "drag element");
});
-test("{ helper: 'clone' }, relative", function() {
- el = $("#draggable1").draggable({ helper: "clone" });
- drag(el, 50, 50);
- moved(0, 0);
-});
-
-test("{ helper: 'clone' }, absolute", function() {
- el = $("#draggable2").draggable({ helper: "clone" });
- drag(el, 50, 50);
- moved(0, 0);
-});
-
-test("{ helper: 'original' }, relative, with scroll offset on parent", function() {
-
- el = $("#draggable1").draggable({ helper: "original" });
-
- setScroll();
- testScroll('relative');
-
- setScroll();
- testScroll('static');
-
- setScroll();
- testScroll('absolute');
-
- restoreScroll();
-
-});
-
-test("{ helper: 'original' }, relative, with scroll offset on root", function() {
-
- el = $("#draggable1").draggable({ helper: "original" });
-
- setScroll('root');
- testScroll('relative');
-
- setScroll('root');
- testScroll('static');
-
- setScroll('root');
- testScroll('absolute');
-
- restoreScroll('root');
-
-});
-
-test("{ helper: 'original' }, relative, with scroll offset on root and parent", function() {
-
- el = $("#draggable1").draggable({ helper: "original" });
-
- setScroll();
- setScroll('root');
- testScroll('relative');
-
- setScroll();
- setScroll('root');
- testScroll('static');
-
- setScroll();
- setScroll('root');
- testScroll('absolute');
-
- restoreScroll();
- restoreScroll('root');
-
-});
-
-test("{ helper: 'original' }, absolute, with scroll offset on parent", function() {
-
- el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" });
-
- setScroll();
- testScroll('relative');
-
- setScroll();
- testScroll('static');
-
- setScroll();
- testScroll('absolute');
-
- restoreScroll();
-
-});
-
-test("{ helper: 'original' }, absolute, with scroll offset on root", function() {
-
- el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" });
-
- setScroll('root');
- testScroll('relative');
-
- setScroll('root');
- testScroll('static');
-
- setScroll('root');
- testScroll('absolute');
-
- restoreScroll('root');
-
-});
-
-test("{ helper: 'original' }, absolute, with scroll offset on root and parent", function() {
-
- el = $("#draggable1").css({ position: 'absolute', top: 0, left: 0 }).draggable({ helper: "original" });
-
- setScroll();
- setScroll('root');
- testScroll('relative');
-
- setScroll();
- setScroll('root');
- testScroll('static');
-
- setScroll();
- setScroll('root');
- testScroll('absolute');
-
- restoreScroll();
- restoreScroll('root');
-
-});
-
-test("{ helper: 'original' }, fixed, with scroll offset on parent", function() {
-
- el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
-
- setScroll();
- testScroll('relative');
-
- setScroll();
- testScroll('static');
-
- setScroll();
- testScroll('absolute');
-
- restoreScroll();
-
-});
-
-test("{ helper: 'original' }, fixed, with scroll offset on root", function() {
-
- el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
-
- setScroll('root');
- testScroll('relative');
-
- setScroll('root');
- testScroll('static');
-
- setScroll('root');
- testScroll('absolute');
-
- restoreScroll('root');
-});
-
-test("{ helper: 'original' }, fixed, with scroll offset on root and parent", function() {
-
- el = $("#draggable1").css({ position: 'fixed', top: 0, left: 0 }).draggable({ helper: "original" });
-
- setScroll();
- setScroll('root');
- testScroll('relative');
-
- setScroll();
- setScroll('root');
- testScroll('static');
-
- setScroll();
- setScroll('root');
- testScroll('absolute');
-
- restoreScroll();
- restoreScroll('root');
-
-});
-
-test("{ helper: 'clone' }, absolute", function() {
-
- var helperOffset = null;
- var origOffset = $("#draggable1").offset();
-
- el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
- helperOffset = ui.helper.offset();
- } });
-
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
-});
-
-test("{ helper: 'clone' }, absolute with scroll offset on parent", function() {
-
- setScroll();
- var helperOffset = null;
- var origOffset = null;
-
- el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
- helperOffset = ui.helper.offset();
- } });
-
- $("#main").css('position', 'relative');
- origOffset = $("#draggable1").offset();
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- $("#main").css('position', 'static');
- origOffset = $("#draggable1").offset();
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- $("#main").css('position', 'absolute');
- origOffset = $("#draggable1").offset();
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- restoreScroll();
-
-});
-
-test("{ helper: 'clone' }, absolute with scroll offset on root", function() {
-
- setScroll('root');
- var helperOffset = null;
- var origOffset = null;
-
- el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
- helperOffset = ui.helper.offset();
- } });
-
- $("#main").css('position', 'relative');
- origOffset = $("#draggable1").offset();
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- $("#main").css('position', 'static');
- origOffset = $("#draggable1").offset();
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- $("#main").css('position', 'absolute');
- origOffset = $("#draggable1").offset();
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- restoreScroll('root');
-
-});
-
-test("{ helper: 'clone' }, absolute with scroll offset on root and parent", function() {
-
- setScroll('root');
- setScroll();
- var helperOffset = null;
- var origOffset = null;
-
- el = $("#draggable1").draggable({ helper: "clone", drag: function(event, ui) {
- helperOffset = ui.helper.offset();
- } });
-
- $("#main").css('position', 'relative');
- origOffset = $("#draggable1").offset()
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- $("#main").css('position', 'static');
- origOffset = $("#draggable1").offset()
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- $("#main").css('position', 'absolute');
- origOffset = $("#draggable1").offset()
- drag(el, 1, 1);
- same({ top: helperOffset.top-1, left: helperOffset.left-1 }, origOffset, 'dragged[' + dragged.dx + ', ' + dragged.dy + '] ');
-
- restoreScroll('root');
- restoreScroll();
-
-});
-
test("{ opacity: 0.5 }", function() {
expect(1);
var el, drg;
-function shouldBeDroppable() {
- ok(false, 'missing test - untested code is broken code');
-}
-
-function shouldNotBeDroppable() {
- ok(false, 'missing test - untested code is broken code');
-}
-
(function($) {
module("droppable: core");
-test("element types", function() {
- var typeNames = ('p,h1,h2,h3,h4,h5,h6,blockquote,ol,ul,dl,div,form'
- + ',table,fieldset,address,ins,del,em,strong,q,cite,dfn,abbr'
- + ',acronym,code,samp,kbd,var,img,object,hr'
- + ',input,button,label,select,iframe').split(',');
-
- $.each(typeNames, function(i) {
- var typeName = typeNames[i];
- el = $(document.createElement(typeName)).appendTo('body');
- (typeName == 'table' && el.append("<tr><td>content</td></tr>"));
- el.droppable();
- shouldBeDroppable();
- el.droppable("destroy");
- el.remove();
- });
-});
-
})(jQuery);
module("droppable: events");
-test("activate", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("deactivate", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("over", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("out", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("drop", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
})(jQuery);
equals(actual, expected, 'destroy is chainable');
});
-test("enable", function() {
- expect(7);
- el = $("#droppable1").droppable({ disabled: true });
- shouldNotBeDroppable();
- el.droppable("enable");
- shouldBeDroppable();
- equals(el.droppable("option", "disabled"), false, "disabled option getter");
- el.droppable("destroy");
- el.droppable({ disabled: true });
- shouldNotBeDroppable();
- el.droppable("option", "disabled", false);
- equals(el.droppable("option", "disabled"), false, "disabled option setter");
- shouldBeDroppable();
-
- var expected = $('<div></div>').droppable(),
- actual = expected.droppable('enable');
- equals(actual, expected, 'enable is chainable');
-});
-
-test("disable", function() {
- expect(7);
- el = $("#droppable1").droppable({ disabled: false });
- shouldBeDroppable();
- el.droppable("disable");
- shouldNotBeDroppable();
- equals(el.droppable("option", "disabled"), true, "disabled option getter");
- el.droppable("destroy");
- el.droppable({ disabled: false });
- shouldBeDroppable();
- el.droppable("option", "disabled", true);
- equals(el.droppable("option", "disabled"), true, "disabled option setter");
- shouldNotBeDroppable();
-
- var expected = $('<div></div>').droppable(),
- actual = expected.droppable('disable');
- equals(actual, expected, 'disable is chainable');
-});
-
})(jQuery);
module("droppable: options");
-test("{ accept '*' }, default ", function() {
- equals(droppable_defaults.accept, '*');
-
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("{ accept: Selector }", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("{ accept: function(draggable) }", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("activeClass", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
test("{ addClasses: true }, default", function() {
equals(droppable_defaults.addClasses, true);
el.droppable("destroy");
});
-test("greedy", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("hoverClass", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("scope", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("tolerance, fit", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("tolerance, intersect", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("tolerance, pointer", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
-test("tolerance, touch", function() {
- ok(false, 'missing test - untested code is broken code');
-});
-
})(jQuery);
module("resizable: events");
-test("start", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("resize", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("stop", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
})(jQuery);
equals(actual, expected, 'destroy is chainable');
});
-test("enable", function() {
- var expected = $('<div></div>').resizable(),
- actual = expected.resizable('enable');
- equals(actual, expected, 'enable is chainable');
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("disable", function() {
- var expected = $('<div></div>').resizable(),
- actual = expected.resizable('disable');
- equals(actual, expected, 'disable is chainable');
- ok(false, "missing test - untested code is broken code.");
-});
-
})(jQuery);
ok(hash, 'start event triggered');
ok(hash.helper, 'UI hash includes: helper');
ok(hash.placeholder, 'UI hash includes: placeholder');
- ok(hash.position && (hash.position.top && hash.position.left), 'UI hash includes: position');
- ok(hash.offset && (hash.offset.top && hash.offset.left), 'UI hash includes: offset');
ok(hash.item, 'UI hash includes: item');
ok(!hash.sender, 'UI hash does not include: sender');
});
-test("receive", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("remove", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("over", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("out", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("activate", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("deactivate", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
})(jQuery);
module("sortable: options");
-test("{ appendTo: 'parent' }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ appendTo: Selector }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ axis: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ axis: 'x' }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ axis: 'y' }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ axis: ? }, unexpected", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ cancel: ':input,button' }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ cancel: Selector }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ connectWith: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ connectWith: Selector }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ containment: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ containment: Element }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ containment: 'document' }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ containment: 'parent' }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ containment: 'window' }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ containment: Selector }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ cursor: 'auto' }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ cursor: 'move' }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ cursorAt: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ cursorAt: true }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ delay: 0 }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ delay: 100 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ distance: 1 }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ distance: 10 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ dropOnEmpty: true }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ dropOnEmpty: false }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ forcePlaceholderSize: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ forcePlaceholderSize: true }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ forceHelperSize: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ forceHelperSize: true }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ grid: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ grid: [17, 3] }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ grid: [3, 7] }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ handle: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ handle: Element }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ handle: Selector }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ helper: 'original' }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ helper: Function }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ items: '> *' }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ items: Selector }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ opacity: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ opacity: .37 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ opacity: 1 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ placeholder: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ placeholder: String }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ revert: false }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ revert: true }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scroll: true }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scroll: false }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scrollSensitivity: 20 }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scrollSensitivity: 2 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scrollSensitivity: 200 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scrollSpeed: 20 }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scrollSpeed: 2 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scrollSpeed: 200 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scope: 'default' }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ scope: ??? }, unexpected", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ tolerance: 'intersect' }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ tolerance: 'pointer' }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ zIndex: 1000 }, default", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ zIndex: 1 }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
-test("{ zIndex: false }", function() {
- ok(false, "missing test - untested code is broken code.");
-});
-
})(jQuery);
});
-test('#4752: link event firing on sortable with connect list', function () {
- var fired = {},
- hasFired = function (type) { return (type in fired) && (true === fired[type]); };
-
- $('#sortable').clone().attr('id', 'sortable2').insertAfter('#sortable');
-
- $('#main ul').sortable({
- connectWith: '#main ul',
- change: function (e, ui) {
- fired.change = true;
- },
- receive: function (e, ui) {
- fired.receive = true;
- },
- remove: function (e, ui) {
- fired.remove = true;
- }
- });
-
- $('#main ul li').live('click.ui-sortable-test', function () {
- fired.click = true;
- });
-
- $('#sortable li:eq(0)').simulate('click');
- ok(!hasFired('change'), 'Click only, change event should not have fired');
- ok(hasFired('click'), 'Click event should have fired');
-
- // Drag an item within the first list
- fired = {};
- $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 40 });
- ok(hasFired('change'), '40px drag, change event should have fired');
- ok(!hasFired('receive'), 'Receive event should not have fired');
- ok(!hasFired('remove'), 'Remove event should not have fired');
- ok(!hasFired('click'), 'Click event should not have fired');
-
- // Drag an item from the first list to the second, connected list
- fired = {};
- $('#sortable li:eq(0)').simulate('drag', { dx: 0, dy: 150 });
- ok(hasFired('change'), '150px drag, change event should have fired');
- ok(hasFired('receive'), 'Receive event should have fired');
- ok(hasFired('remove'), 'Remove event should have fired');
- ok(!hasFired('click'), 'Click event should not have fired');
-});
-
})(jQuery);
function testWidgetOverrides(widget) {
test('$.widget overrides', function() {
- $.each(['_widgetInit', 'option', '_trigger'], function(i, method) {
+ $.each(['_widgetInit', 'option'], function(i, method) {
ok($.Widget.prototype[method] == $.ui[widget].prototype[method],
'should not override ' + method);
});