Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
// #### Listen to the viewport and change user-menu dropdown triangle classes accordingly
this.set('swapUserMenuDropdownTriangleClasses', Ember.run.bind(this, swapUserMenuDropdownTriangleClasses));
mobileQuery.addListener(this.get('swapUserMenuDropdownTriangleClasses'));
swapUserMenuDropdownTriangleClasses(mobileQuery);
this.set('closeGlobalMobileNavOnDesktop', Ember.run.bind(this, function closeGlobalMobileNavOnDesktop(mq) {
if (!mq.matches) {
// Is desktop sized
this.set('controller.showGlobalMobileNav', false);
}
}));
mobileQuery.addListener(this.get('closeGlobalMobileNavOnDesktop'));
},
}
});
});
function swapUserMenuDropdownTriangleClasses(mq) {
if (mq.matches) {
$('.js-user-menu-dropdown-menu').removeClass('dropdown-triangle-top-right ').addClass('dropdown-triangle-bottom');
} else {
$('.js-user-menu-dropdown-menu').removeClass('dropdown-triangle-bottom').addClass('dropdown-triangle-top-right');
}
}
// #### Listen to the viewport and change user-menu dropdown triangle classes accordingly
this.set('swapUserMenuDropdownTriangleClasses', Ember.run.bind(this, swapUserMenuDropdownTriangleClasses));
mobileQuery.addListener(this.get('swapUserMenuDropdownTriangleClasses'));
swapUserMenuDropdownTriangleClasses(mobileQuery);
this.set('closeGlobalMobileNavOnDesktop', Ember.run.bind(this, function closeGlobalMobileNavOnDesktop(mq) {
if (!mq.matches) {
// Is desktop sized
this.set('controller.showGlobalMobileNav', false);
}
}));
mobileQuery.addListener(this.get('closeGlobalMobileNavOnDesktop'));
},
attachChangeLayout: function () {
mobileQuery.addListener(this.changeLayout);
}.on('didInsertElement'),
attachChangeLayout: function () {
mobileQuery.addListener(this.changeLayout);
}.on('didInsertElement'),