travis-web/app/views/application.js
2016-01-04 13:15:15 +01:00

19 lines
551 B
JavaScript

import BasicView from 'travis/views/basic';
import Ember from 'ember';
export default BasicView.extend({
popup: Ember.inject.service(),
classNames: ['application'],
click(event) {
var targetAndParents;
targetAndParents = $(event.target).parents().andSelf();
if (!(targetAndParents.hasClass('open-popup') || targetAndParents.hasClass('popup'))) {
this.get('popup').close();
}
if (!targetAndParents.hasClass('menu') && !targetAndParents.is('#tools > a')) {
return $('.menu').removeClass('display');
}
}
});