arcanus55 / neodigm55

An eclectic low-code vanilla JavaScript UX micro-library for those that defiantly think for themselves.
https://thescottkrause.com/emerging_tech/neodigm55_ux_library/
BSD 3-Clause "New" or "Revised" License
17 stars 2 forks source link

Neodigm Tulip | Grandfather element declarative issue #75

Closed neodigm closed 1 year ago

neodigm commented 1 year ago

Tooltip not firing on elements when 3 elements deep. Example are the number % in the KPI on the landing page. Also, on the same page one of the copy buttons icon.

neodigm commented 1 year ago

UPDATE: Create walkDOM3 method. Testing is on-going.

neodigm commented 1 year ago

This is complete in v3.0. Implemented on the Tulip and Wired4Sound components. No doc changes.

    walkDOM3: function( elEv, sDatAtr ){  //  Walk up two nodes, parent, grand parent
        if( elEv?.dataset[ sDatAtr ] ) return elEv.dataset[ sDatAtr ]
        if( elEv?.parentNode?.dataset[ sDatAtr ] ) return elEv.parentNode.dataset[ sDatAtr ]
        if( elEv.tagName != "BODY" && elEv?.parentNode?.parentNode?.dataset[ sDatAtr ] ) return elEv.parentNode.parentNode.dataset[ sDatAtr ]
    }

let sCnf = neodigmUtils.walkDOM3( ev?.target, "n55Tulip" )