File tree 1 file changed +12
-1
lines changed
1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ module AttributeActions = struct
93
93
let arg =
94
94
Jv. obj
95
95
[|
96
- ( " set_class " ,
96
+ ( " set_style " ,
97
97
Jv. callback ~arity: 3 @@ fun elem style value ->
98
98
let old_value =
99
99
let old_value = Brr.El. inline_style style elem in
@@ -109,6 +109,17 @@ module AttributeActions = struct
109
109
in
110
110
undos_ref := undo :: ! undos_ref;
111
111
Jv. callback ~arity: 1 undo );
112
+ ( " set_class" ,
113
+ Jv. callback ~arity: 3 @@ fun elem class_ bool ->
114
+ let bool = Jv. to_bool bool in
115
+ Brr.Console. (log [ " set_class called with" ; elem; class_; bool ]);
116
+ let old_value = Brr.El. class ' class_ elem in
117
+ Brr.El. set_class class_ bool elem;
118
+ let undo _ =
119
+ Fut. return @@ Brr.El. set_class class_ old_value elem
120
+ in
121
+ undos_ref := undo :: ! undos_ref;
122
+ Jv. callback ~arity: 1 undo );
112
123
| ]
113
124
in
114
125
let u = f arg in
You can’t perform that action at this time.
0 commit comments