2017-07-14 11:06:49 -04:00
|
|
|
/* eslint-disable class-methods-use-this */
|
2017-03-11 01:45:34 -05:00
|
|
|
|
|
|
|
import Cookies from 'js-cookie';
|
2017-06-30 18:48:54 -04:00
|
|
|
import UserTabs from './user_tabs';
|
2016-12-13 22:01:05 -05:00
|
|
|
|
2017-07-14 11:06:49 -04:00
|
|
|
export default class User {
|
2017-07-05 13:20:41 -04:00
|
|
|
constructor({ action }) {
|
|
|
|
this.action = action;
|
|
|
|
this.placeProfileAvatarsToTop();
|
|
|
|
this.initTabs();
|
|
|
|
this.hideProjectLimitMessage();
|
|
|
|
}
|
2016-08-04 14:18:00 -04:00
|
|
|
|
2017-07-05 13:20:41 -04:00
|
|
|
placeProfileAvatarsToTop() {
|
|
|
|
$('.profile-groups-avatars').tooltip({
|
2017-07-14 11:06:49 -04:00
|
|
|
placement: 'top',
|
2017-07-05 13:20:41 -04:00
|
|
|
});
|
|
|
|
}
|
2016-08-04 14:18:00 -04:00
|
|
|
|
2017-07-05 13:20:41 -04:00
|
|
|
initTabs() {
|
2017-06-30 18:48:54 -04:00
|
|
|
return new UserTabs({
|
2017-07-05 13:20:41 -04:00
|
|
|
parentEl: '.user-profile',
|
2017-07-14 11:06:49 -04:00
|
|
|
action: this.action,
|
2017-07-05 13:20:41 -04:00
|
|
|
});
|
|
|
|
}
|
2016-08-04 14:18:00 -04:00
|
|
|
|
2017-07-05 13:20:41 -04:00
|
|
|
hideProjectLimitMessage() {
|
2017-07-14 11:06:49 -04:00
|
|
|
$('.hide-project-limit-message').on('click', (e) => {
|
2017-07-05 13:20:41 -04:00
|
|
|
e.preventDefault();
|
|
|
|
Cookies.set('hide_project_limit_message', 'false');
|
|
|
|
$(this).parents('.project-limit-message').remove();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|