Skip to content

Commit 5820fce

Browse files
committed
proxy all pod options
1 parent d350993 commit 5820fce

File tree

2 files changed

+37
-6
lines changed

2 files changed

+37
-6
lines changed

examples/simple-list/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use wasm_bindgen::prelude::*;
33
fn main() {
44
web_sys::console::log_1(&JsValue::from_str("Wasm init complete"));
55
sortable_js::Options::new()
6-
.set_group("test")
6+
.animation_ms(150.)
77
.apply(
88
&web_sys::window()
99
.expect("had no window")

src/lib.rs

Lines changed: 36 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,42 @@ impl Options {
3434
Options(js_sys::Object::new())
3535
}
3636

37-
option!(set_group, "group", &str, from_str);
38-
option!(set_sort, "sort", bool, from_bool);
39-
option!(set_delay, "delay", f64, from_f64);
40-
option!(set_disabled, "disabled", bool, from_bool);
41-
option!(set_handle, "handle", &str, from_str);
37+
option!(group, "group", &str, from_str);
38+
option!(sort, "sort", bool, from_bool);
39+
option!(delay, "delay", f64, from_f64);
40+
option!(delay_on_touch_only, "delayOnTouchOnly", bool, from_bool);
41+
option!(touch_start_threshold, "touchStartThreshold", f64, from_f64);
42+
option!(disabled, "disabled", bool, from_bool);
43+
// TODO: consider supporting the Store option
44+
option!(animation_ms, "animation", f64, from_f64);
45+
option!(easing, "easing", &str, from_str);
46+
option!(handle, "handle", &str, from_str);
47+
option!(filter, "filter", &str, from_str);
48+
option!(prevent_on_filter, "preventOnFilter", bool, from_bool);
49+
option!(draggable, "draggable", &str, from_str);
50+
51+
option!(data_id_attr, "dataIdAttr", &str, from_str);
52+
53+
option!(ghost_class, "ghostClass", &str, from_str);
54+
option!(chosen_class, "chosenClass", &str, from_str);
55+
option!(drag_class, "dragClass", &str, from_str);
56+
57+
option!(swap_threshold, "swapThreshold", f64, from_f64);
58+
option!(invert_swap, "invertSwap", bool, from_bool);
59+
option!(inverted_swap_threshold, "invertedSwapThreshold", f64, from_f64);
60+
option!(direction, "direction", &str, from_str);
61+
62+
option!(force_fallback, "forceFallback", bool, from_bool);
63+
64+
option!(fallback_class, "fallbackClass", &str, from_str);
65+
option!(fallback_on_body, "fallbackOnBody", bool, from_bool);
66+
option!(fallback_tolerance, "fallbackTolerance", f64, from_f64);
67+
68+
option!(dragover_bubble, "dragoverBubble", bool, from_bool);
69+
option!(remove_clone_on_hide, "removeCloneOnHide", bool, from_bool);
70+
option!(empty_insert_threshold, "emptyInsertThreshold", f64, from_f64);
71+
72+
// TODO: all the callbacks
4273

4374
pub fn apply(&self, elt: &web_sys::Element) {
4475
js::Sortable::new(elt, &self.0);

0 commit comments

Comments
 (0)