Skip to content

{{data-attribute}} Not Matching #2

@tpitale

Description

@tpitale

Because of the change from the previous issue fixing delegation, the $elem in getReplacement() is not what I would expect.

Doing this doesn't work:

trackiffer({
  'body.controller.index' : {
    delegate : '#some_form',
    rule : ['_trackEvent', 'form', 'submit', '{{data-thing-id}}']
  }
});

Doing this does:

trackiffer({
  'body.controller.index' : {
    delegate : '#some_form',
    rule : ['_trackEvent', 'form', 'submit', function($elem){return $elem.find("#some_form").attr('data-thing-id')}]
  }
});

$elem appears to be assigned to the matched element for 'body.controller.index', rather than the delegated match.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions