Hello,
i have a problem with the didInsertElement and resize function… i want at a specific window width change a class of an element. but the change is only there if i load the site. if i change then the window size he do nothing…
here is my code:
import Ember from "ember";
var IndexView = Ember.View.extend({
classNames: ['index'],
//touchStart: Ember.alias('click'),
didInsertElement: function() {
$('.mainmenu div').removeClass('open').addClass('close');
var width = $(window).width();
if (width >= 851) {
$('.lobby-footer .send-gift li').removeClass('right').addClass('left');
$('.lobby-footer .send-gift a').removeClass('btn-right').addClass('btn-left');
}else {
$('.lobby-footer .send-gift li').removeClass('left').addClass('right');
$('.lobby-footer .send-gift a').removeClass('btn-left').addClass('btn-right');
}
},
willDestroy: function() {
},
resize: function() {
}
});
export default IndexView;
its all the same if i put the code in idInsertElement: function() or at resize: function() nothing works…
anyone any idea? What i do wrong?
Avi