diff --git a/editor/src/handle_mutation.rs b/editor/src/handle_mutation.rs index 62cdbf1..ef8fdd3 100644 --- a/editor/src/handle_mutation.rs +++ b/editor/src/handle_mutation.rs @@ -38,6 +38,7 @@ pub fn handle_mutation( } } "attributes" => { + log!("change attr"); // TODO save attributes if let Some(element) = current_element.parent_element() { // log!(element.get_attribute("class")); if let Ok(id) = Uuid::parse_str(element.id().as_ref()).map(Id::from) { diff --git a/editor/src/utils/mod.rs b/editor/src/utils/mod.rs index 622418b..a2c413a 100644 --- a/editor/src/utils/mod.rs +++ b/editor/src/utils/mod.rs @@ -62,7 +62,8 @@ pub fn on_slash_input( tree_id: element_tree.id, parent_id: *parent_id.unwrap_or(¤t_element), children: adjacency.get(&i.id).cloned(), - prev_element_id: Some(current_element), + // TODO fix this prev_element_id: Some(current_element), + prev_element_id: None, })); } return Some((id, changes)); diff --git a/frontend/src/editor_components/table/mod.rs b/frontend/src/editor_components/table/mod.rs index 702413c..5e2f78d 100644 --- a/frontend/src/editor_components/table/mod.rs +++ b/frontend/src/editor_components/table/mod.rs @@ -18,7 +18,7 @@ use editor::plugins::Position; use shared::id::Id; use shared::schema::{EditorChange, EditorElement}; use wasm_bindgen::UnwrapThrowExt; -use web_sys::{window, HtmlInputElement, HtmlTableCellElement, MouseEvent}; +use web_sys::{window, HtmlInputElement, HtmlTableCellElement, MouseEvent, HtmlElement}; use yew::prelude::*; use yew::{function_component, html}; use yew_hooks::prelude::*; @@ -48,10 +48,18 @@ pub fn Table(props: &Props) -> Html { let on_column_contextmenu = { let global_state = global_state.clone(); Callback::from(move |mouse_event: MouseEvent| { + let curr :HtmlElement = mouse_event.target_unchecked_into(); + let element = html! { context = {global_state.clone()}> {"add formula"}}, + html!{{"add formula"}}, html!{{"add filter"}},]} event = {mouse_event.clone()}/ > > };