Browse files

draggable added

  • Loading branch information...
1 parent 5cdc95a commit 733cd932c8bc5c2fa2e8fbd5cea89592367d5af4 @klimacampimrheinland klimacampimrheinland committed Jul 5, 2012
View
30 jquery-ui-demo.opa
@@ -2,7 +2,37 @@ import jQueryUI
//type demo_page = { string name, ( -> xhtml) show }
//type demo = { string name, list(demo_page) pages }
+module Draggable {
+ demo =
+ { name: "Draggable"
+ , pages:
+ [ {name: "Default-sort", show: default_functionality }
+ ,{name: "on_update-drag" , show: on_update_demo }
+ ]
+ }
+
+
+ client function default_functionality(){
+ function mk_draggable(_) {
+ jQueryUI.Draggable.mk_draggable(#draggable)
+ //return js_void;
+ }
+
+ <div style="background:#cccccc" onready={mk_draggable}>bla</div>
+
+ }
+
+ client function on_update_demo(){
+ function mk_draggable(_) {
+ jQueryUI.Draggable.mk_draggable(#draggable)
+ //return js_void;
+ }
+
+ <div id=draggable style="background:#cccccc" onready={mk_draggable}>bla</div>
+ }
+
+}
module Sortable {
demo =
View
6 packages/jQueryUI/jQueryUI.opa
@@ -20,5 +20,11 @@ module jQueryUI {
}
}
+ module Draggable {
+ function void mk_draggable(dom) {
+ elt = Dom.of_selection(dom)
+ %%JQueryUI.mk_draggable%%(elt)
+ }
+ }
}
View
2 packages/jQueryUI/jQueryUI/Makefile
@@ -2,7 +2,7 @@
# USER VARIABLES
MKLIB = opa-plugin-builder
PLUGNAME = jQueryUI.opp
-SRC = jQueryUI.js ui/jquery.ui.widget.js ui/jquery.ui.core.js ui/jquery.ui.mouse.js ui/jquery.ui.sortable.js
+SRC = jQueryUI.js ui/jquery.ui.widget.js ui/jquery.ui.core.js ui/jquery.ui.mouse.js ui/jquery.ui.sortable.js ui/jquery.ui.draggable.js
#ui/jquery-ui.js
########################################
View
6 packages/jQueryUI/jQueryUI/jQueryUI.js
@@ -20,3 +20,9 @@
return dom.bind( "sortupdate", function(event, ui) { on_update(); } );
}
+##register mk_draggable: Dom.private.element -> void
+##args(dom)
+{
+ dom.draggable();
+ return js_void;
+}

0 comments on commit 733cd93

Please sign in to comment.