html-next / ember-hammertime

TouchAction (aka "fastclick") Support for Ember Applications
MIT License
56 stars 23 forks source link

`<div onclick={{action` cases #15

Closed miguelcobain closed 7 years ago

miguelcobain commented 8 years ago

Can the AST walker handle <div onclick={{action cases?

eriktrom commented 8 years ago

@miguelcobain - yes although b/c there are no event listeners, and its not a link or button, it doesn't make much sense until javascript loads (and replaces the dom anyway)

However - does work if u have a use case (from your project, ember paper):

{{#paper-item onClick=onClick class=(concat "menu-item" (if active ' active') (if expanded ' expanded'))}}
  {{yield}}
  {{#if canExpand}}
    {{paper-icon 'expand-more' class='expand-icon'}}
  {{/if}}
{{/paper-item}}

--> ast transformed html (from server)

<div id="ember461" class="ember-view"><md-list-item id="ember462" style="touch-action: manipulation; -ms-touch-action: manipulation; cursor: pointer;" class="menu-item ember-view md-clickable"><div class="md-no-style md-list-item-inner">
  Components
    <md-icon id="ember472" style class="expand-icon ember-view paper-icon md-font material-icons md-default-theme">expand_more</md-icon>

</div>
runspired commented 7 years ago

Resolved this in 1.1.1

Have fun @miguelcobain :)

miguelcobain commented 7 years ago

<3