Skip to content

Allow icons in data-action element #56

@papajin

Description

@papajin

Hi niiknow,
Thank you for your component! It spared me some time and a lot of nerves.
I would suggest to use e.currentTarget instead of e.target in the data-action element click handler.

$el.on('click', '[data-action]', function (e) {
      e.preventDefault();
      e.stopPropagation();
      var target = jq(e.target); // <--here jq(e.currentTarget); 
      var action = target.attr('data-action'); // no action, simply exit
      if (!action) {
        return;
      } else {
        var tr = target; // detect if action is inside a row
        // get data from parent row/tr
        ...
     }
     ....
}

Current code breaks at the if (!action) return, if icon clicked.
Thank you once again!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions