RSS Feed/News Weird quirk with buttons and xf-init...

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
26,003
Points
823

Reputation:

I have a button:
Code:

Code:
    <xf:button href="TEST_LINK" class="button--cta TEST_JS">
        TEST_BUTTON
    </xf:button>

Then in my javascript I have the following:
Code:

Code:
    XF.Element.register('TEST_JS', 'TEST.ClickButton');

TEST.ClickButton = XF.Element.newHandler(
    {
        init: function()
        {
            XF.on(this.target, 'click', this.click.bind(this));
        },

click: function(e)
        {
            e.preventDefault()...

Read more

Continue reading...
 
Status
Not open for further replies.
Top