I think I have found the div element corresponding to the Member status. . [Log] dblclick event.currentTarget.dataset: [object DOMStringMap] (app.js, line 3268) [Log] dblclick event.currentTarget.dataset.edit: memstat (app.js, line 3269) [Log] canx called from Cancel button (app.js, line 3998) [Log] event: [object MouseEvent] parent: [object HTMLButtonElement] (app.js, line 4001) [Log] parent: [object HTMLButtonElement] memstatElement: [object HTMLDivElement] (app.js, line 4002) [Log] preventing default (app.js, line 4003) [Log] memstatElement.dataset: [object DOMStringMap] (app.js, line 4004)
This verifies that I have the right div element... [Log] memstatElement.dataset.edit: memstat (app.js, line 4005) But calling preventDefault on the event doesn't appear to do anything. It still calls the POST behavior, and does not cause the inline edit menu to disappear. And setting the edit function to nil doesn't do anything either. Maybe there is something else that I need to do? Here's the canx function: def canx(event) console.log('canx called from Cancel button') parent = event.currentTarget memstatElement = parent.closest('.row') console.log('event: ' + event + ' parent: ' + parent) console.log('parent: ' + parent + ' memstatElement: ' + memstatElement) console.log('preventing default') console.log('memstatElement.dataset: ' + memstatElement.dataset) console.log('memstatElement.dataset.edit: ' + memstatElement.dataset.edit) event.preventDefault() memstatElement.dataset.edit = nil end > On May 25, 2020, at 6:02 PM, Sam Ruby <ru...@intertwingly.net> wrote: > > On Mon, May 25, 2020 at 8:07 PM Craig Russell <apache....@gmail.com> wrote: >> >> I've implemented the cancel button for the Member status row of the >> committer display. >> >> When the (cancel) button is pressed, the canx function is invoked. What I >> want to do here is to call dblclick on the div element so the inline form >> disappears with no action. >> >> But how can I find the HTMLDivElement to call dblclick on? I cannot find the >> relationship between the inline form and the div that contains the dblclick >> event. > > closest('.row') > > You can use either standard DOM APIs or jQuery: > > https://developer.mozilla.org/en-US/docs/Web/API/Element/closest > https://api.jquery.com/closest/ > > - Sam Ruby Craig L Russell c...@apache.org