ember.js - didInsertElement event and unless block -
i'm trying this:
didinsertelement: function(){ this.$('[data-hover="dropdown"]').dropdownhover(); },
and have anchor data-hover="dropdown" in {{unless}} block.
but anchor isnt in dom @ didinsertelement.
is there other event this?
there few ways approach this. 1 possibility add observer watches changes same property unless block. when observer triggers add dropdownhover() code afterrender queue.
far simpler make anchor tag custom view , customize it's didinsertelement hook. like:
app.dropdownlink = ember.view.extend({ tagname: 'a' didinsertelement: function(){ this.$('[data-hover="dropdown"]').dropdownhover(); } })
Comments
Post a Comment