notion.so so when you hover on an element a dragging icon appears then you drag the entire element by dragging the icon.document.event_listener('ondragenter',...).
let prev_element = null;
let prev_element_inner_html = null;
fn on_mouse_enter(event){
if prev_element(){
let elemnt = document.query_selelctor(`.${prev_element.attributes.class}`)
// unrape the prev element
element.inner_html = prev_element_inner_html
}
let elemnt = document.query_selelctor(`.${event.target.attributes.class}`)
element.inner_html = `<span class="wrapper"><span class="drag_icon></span>${element.inner_html}<span>`
}
Goal I want to check if you have better ideas because this solution is too long and requires me to check the entire dom and `set_attribute('mouseenter',"on_mouse_enter") for each single element.
Note I can't use packages or yew or reactjs because my project requires too many other functionalities that require pure rust or pure javascript