mardi 14 août 2018

Can I add a class to a div, when hovering over another class, without using jQuery in Ember

I have created a table in Ember, and when I hover over the specific header cell for a column, I want to highlight the entire column.

I accomplished this quite easily, but I'm told that this may not be "the ember way".

New to ember, so I'm double checking.

HTML

  • onmouseover I call highlightBlocks I send the ID of the header cell
  • onmouseout I call unhighlightBlocks (removes class, not adding it because)

Ember component

highlightBlocks(value) {
 this.$(`.${value}`).addClass('highlighted-block');
}

Is there a better way to do this? What's the ember way?




Aucun commentaire:

Enregistrer un commentaire