Header events not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • codeboy
    Senior Member
    • May 2018
    • 112

    Header events not working

    I add new propery site/header.js and events for example;
    Code:
    'click a.action': function (e) {
        console.log("test");
    },
    
    actionTest: function () {
        this.getRouter().dispatch(null, 'test');
        this.getRouter().navigate('', {trigger: false});
    },
    Html;
    Code:
    <li><a href="action" data-action="test">Test</a></li>
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2

    Hi, click a.action
    <a href="action" .. you don't have class action

    Comment

    • codeboy
      Senior Member
      • May 2018
      • 112

      #3
      Originally posted by tanya
      Hi, click a.action
      <a href="action" .. you don't have class action
      You're right. I arranged it this way. But it still doesn't work.
      Nothing triggers and no error messages. Please help

      Code:
      <li>
        <a href="javascript:;" class="action" data-action="test">Test</a>
      </li>
      Code:
      'click a.action': function (e) {
          console.log("Test");
      }
      Code:
      actionTest: function () {
          this.getRouter().dispatch(null, 'logout');
          this.getRouter().navigate('', {trigger: false});
      }

      Comment

      Working...