Last change
on this file since 24245 was 24245, checked in by sjb48, 13 years ago |
Oran code for supporting format changes to document.
|
-
Property svn:executable
set to
*
|
File size:
799 bytes
|
Line | |
---|
1 | /*
|
---|
2 | * sortable_tickets.js
|
---|
3 | */
|
---|
4 | (function($) {
|
---|
5 |
|
---|
6 | var el, offsetBefore, offsetAfter, dragged;
|
---|
7 |
|
---|
8 | var drag = function(handle, dx, dy) {
|
---|
9 | offsetBefore = $(handle).offset();
|
---|
10 | $(handle).simulate("drag", {
|
---|
11 | dx: dx || 0,
|
---|
12 | dy: dy || 0
|
---|
13 | });
|
---|
14 | dragged = { dx: dx, dy: dy };
|
---|
15 | offsetAfter = $(handle).offset();
|
---|
16 | }
|
---|
17 |
|
---|
18 | var sort = function(handle, dx, dy, index, msg) {
|
---|
19 | drag(handle, dx, dy);
|
---|
20 | equals($(handle).parent().children().index(handle), index, msg);
|
---|
21 | }
|
---|
22 |
|
---|
23 | module("sortable: tickets");
|
---|
24 |
|
---|
25 | test("#3019: Stop fires too early", function() {
|
---|
26 |
|
---|
27 | var helper = null;
|
---|
28 | el = $("#sortable").sortable({
|
---|
29 | stop: function(event, ui) {
|
---|
30 | helper = ui.helper;
|
---|
31 | }
|
---|
32 | });
|
---|
33 |
|
---|
34 | sort($("li", el)[0], 0, 40, 2, 'Dragging the sortable');
|
---|
35 | equals(helper, null, "helper should be false");
|
---|
36 |
|
---|
37 | });
|
---|
38 |
|
---|
39 | })(jQuery);
|
---|
Note:
See
TracBrowser
for help on using the repository browser.