comparison demo/more/dragList.ur @ 917:321a2d6feb40

dragList demo working, save for Gecko load delay and highlighting
author Adam Chlipala <adamc@hcoop.net>
date Tue, 08 Sep 2009 10:55:49 -0400
parents b873feb3eb52
children 6a77c3e33908
comparison
equal deleted inserted replaced
916:b873feb3eb52 917:321a2d6feb40
8 <li onmousedown={set draggingItem (Some itemSource)} 8 <li onmousedown={set draggingItem (Some itemSource)}
9 onmouseup={set draggingItem None} 9 onmouseup={set draggingItem None}
10 onmouseover={di <- get draggingItem; 10 onmouseover={di <- get draggingItem;
11 case di of 11 case di of
12 None => return () 12 None => return ()
13 | Some di => item1 <- get di; 13 | Some di => original <- get di;
14 item2 <- get itemSource; 14 movedOver <- get itemSource;
15 set di item2; 15 set di movedOver;
16 set itemSource item1}> 16 set itemSource original;
17 <dyn signal={s <- signal itemSource; return <xml>{[s]}</xml>}/> 17 set draggingItem (Some itemSource)}>
18 <dyn signal={Monad.mp (fn s => <xml>{[s]}</xml>) (signal itemSource)}/>
18 </li></xml>) itemSources} 19 </li></xml>) itemSources}
19 </ul> 20 </ul>
20 </xml> 21 </xml>
21 22
22 fun main () = 23 fun main () =
24 beers <- draggableList "Beers" ("Budvar" :: "Delirium Tremens" :: "Deuchars" :: []); 25 beers <- draggableList "Beers" ("Budvar" :: "Delirium Tremens" :: "Deuchars" :: []);
25 boars <- draggableList "Boars" ("Sus scrofa scrofa" 26 boars <- draggableList "Boars" ("Sus scrofa scrofa"
26 :: "Sus scrofa ussuricus" 27 :: "Sus scrofa ussuricus"
27 :: "Sus scrofa cristatus" 28 :: "Sus scrofa cristatus"
28 :: "Sus scrofa taiwanus" :: []); 29 :: "Sus scrofa taiwanus" :: []);
29 return <xml><body> 30 return <xml>
30 {bears} 31 <head>
31 {beers} 32 <link rel="stylesheet" type="text/css" href="../../dragList.css"/>
32 {boars} 33 </head>
33 </body></xml> 34 <body>
35 {bears}
36 {beers}
37 {boars}
38 </body>
39 </xml>