mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-10-27 10:03:38 +00:00
This PR adds reply option to notifications of macOS using `node-mac-notifier` and then post the reply for to the webapp. It also fixes an issue that even though the app is focused the server that sent the notification did not focus. And it also adds parsing for mentioning. This also refactors code for notification. Fixes: #284, #381.
44 lines
1.0 KiB
JavaScript
44 lines
1.0 KiB
JavaScript
'use strict';
|
|
|
|
const Tab = require(__dirname + '/../components/tab.js');
|
|
|
|
class FunctionalTab extends Tab {
|
|
template() {
|
|
return `<div class="tab functional-tab" data-tab-id="${this.props.tabIndex}">
|
|
<div class="server-tab-badge close-button">
|
|
<i class="material-icons">close</i>
|
|
</div>
|
|
<div class="server-tab">
|
|
<i class="material-icons">${this.props.materialIcon}</i>
|
|
</div>
|
|
</div>`;
|
|
}
|
|
|
|
init() {
|
|
this.$el = this.generateNodeFromTemplate(this.template());
|
|
this.props.$root.appendChild(this.$el);
|
|
|
|
this.$closeButton = this.$el.getElementsByClassName('server-tab-badge')[0];
|
|
this.registerListeners();
|
|
}
|
|
|
|
registerListeners() {
|
|
super.registerListeners();
|
|
|
|
this.$el.addEventListener('mouseover', () => {
|
|
this.$closeButton.classList.add('active');
|
|
});
|
|
|
|
this.$el.addEventListener('mouseout', () => {
|
|
this.$closeButton.classList.remove('active');
|
|
});
|
|
|
|
this.$closeButton.addEventListener('click', e => {
|
|
this.props.onDestroy();
|
|
e.stopPropagation();
|
|
});
|
|
}
|
|
}
|
|
|
|
module.exports = FunctionalTab;
|