Skip to content

Commit fb2b2e7

Browse files
authored
Merge pull request #16 from cyclejs-community/manyFixes
Fix mousemove bug, ghost offset bug, requiring children if no handle …
2 parents 2897020 + c4535d4 commit fb2b2e7

File tree

14 files changed

+1698
-1019
lines changed

14 files changed

+1698
-1019
lines changed

examples/horizontal/css/main.css

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
font-size: 35px;
33
}
44

5+
html {
6+
box-sizing: border-box;
7+
}
8+
*, *:before, *:after {
9+
box-sizing: inherit;
10+
}
11+
512
body, html {
613
max-height: 100%;
714
margin: 0;
@@ -13,6 +20,7 @@ body {
1320

1421
ul {
1522
margin: 0;
23+
position: relative;
1624
}
1725

1826
li {

examples/parentSelector/css/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ body {
1313

1414
ul {
1515
margin: 0;
16+
position: relative;
1617
}
1718

1819
li {

examples/simple/css/main.css

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
font-size: 35px;
33
}
44

5+
html {
6+
box-sizing: border-box;
7+
}
8+
*, *:before, *:after {
9+
box-sizing: inherit;
10+
}
11+
512
body, html {
613
max-height: 100%;
714
margin: 0;
@@ -13,13 +20,18 @@ body {
1320

1421
ul {
1522
margin: 0;
23+
position: relative;
1624
}
1725

1826
li {
19-
padding: 5px;
27+
/*padding: 5px;*/
2028
background: lightgray;
2129
}
2230

2331
li + li {
24-
margin-top: 40px;
32+
margin-top: 5px;
33+
}
34+
35+
.ghost {
36+
border: 1px solid black;
2537
}

examples/simple/src/index.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,33 @@ import { ul, li, makeDOMDriver, DOMSource, VNode } from '@cycle/dom';
55
import { makeSortable } from '../../../src/makeSortable';
66

77
type Sources = {
8-
DOM : DOMSource;
8+
DOM: DOMSource;
99
};
1010

1111
type Sinks = {
12-
DOM : Stream<VNode>;
12+
DOM: Stream<VNode>;
1313
};
1414

15-
function main({ DOM } : Sources) : Sinks
16-
{
17-
const vdom$ : Stream<VNode> = xs.of(
18-
ul('.ul', [
19-
li('.li', '', ['Option 1']),
20-
li('.li', '', ['Option 2']),
21-
li('.li', '', ['Option 3']),
22-
li('.li', '', ['Option 4']),
23-
li('.li', '', ['Option 5']),
24-
li('.li', '', ['Option 6']),
25-
])
26-
)
27-
.compose(makeSortable<Stream<VNode>>(DOM));
15+
function main({ DOM }: Sources): Sinks {
16+
const vdom$: Stream<VNode> = xs
17+
.of(
18+
ul('.ul', [
19+
li('.li', '', [
20+
'You have to hold for 500ms to start reordering'
21+
]),
22+
li('.li', '', ['Option 2']),
23+
li('.li', '', ['Option 3']),
24+
li('.li', '', ['Option 4']),
25+
li('.li', '', ['Option 5']),
26+
li('.li', '', ['Option 6'])
27+
])
28+
)
29+
.compose(
30+
makeSortable<Stream<VNode>>(DOM, {
31+
ghostClass: '.ghost',
32+
selectionDelay: 500
33+
})
34+
);
2835

2936
return {
3037
DOM: vdom$

examples/updateEvent/css/main.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ body {
1313

1414
ul {
1515
margin: 0;
16+
position: relative;
1617
}
1718

1819
li {

0 commit comments

Comments
 (0)