The dbl element of the dblclick element changes after the click event when the dom element is deleted

I have a weird issue with Firefox that doesn't seem to happen on safari.

There is a table with a set of rows, each of which has its own onclick and ondblclick events. When one of the objects is double-clicked, it first runs a function related to onclick (as expected), where the other line is deleted (other than double-clicking). Subsequently, the dblclick-related function will not work.

If I comment on a line that deletes a line (and not the one that was pressed, as I said, but one more), then both onclick and ondblclick events will fire ... I am attaching you code for both event functions:

ret.onclick = function(){
    // Trigger click event
    var evt = arguments[0] || window.event;
    self.signalClick(evt.target || evt.srcElement);

    if(elem == this.selected) return;

    if(self.selected != null){
        // Set list element to not selected
        var telem = document.getElementById(self.getChildID(self.selected['id']));
        telem.setAttribute('class', 'gui_list_uselected');

        // Remove previously selected element summary
        var telemexp = document.getElementById(self.getChildID(self.selected['id']) + '_exp');
        if(telemexp) telemexp.parentNode.removeChild(telemexp); // FAULTY LINE!
    }

    ret.setAttribute('class', 'gui_list_selected');
    self.selected = elem;

    // Add element summary to the list
    appendAfter(ret, self.drawSummary(elem));
};

ret.ondblclick = function(){
    // Trigger double click event
    var evt = arguments[0] || window.event;
    self.signalDblClick(evt.target || evt.srcElement);
};
+3
source share
1

Firefox . spec, onclick ondblclick . , .

0

All Articles