mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-18 11:41:46 +03:00
tidy up tray.js - it made my eyes hurt
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
808240eef9
commit
aa7728cad3
1 changed files with 8 additions and 8 deletions
|
@ -21,15 +21,15 @@ let trayIcon = null;
|
||||||
|
|
||||||
exports.hasTray = function hasTray() {
|
exports.hasTray = function hasTray() {
|
||||||
return (trayIcon !== null);
|
return (trayIcon !== null);
|
||||||
}
|
};
|
||||||
|
|
||||||
exports.create = function (win, config) {
|
exports.create = function(win, config) {
|
||||||
// no trays on darwin
|
// no trays on darwin
|
||||||
if (process.platform === 'darwin' || trayIcon) {
|
if (process.platform === 'darwin' || trayIcon) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const toggleWin = function () {
|
const toggleWin = function() {
|
||||||
if (win.isVisible() && !win.isMinimized()) {
|
if (win.isVisible() && !win.isMinimized()) {
|
||||||
win.hide();
|
win.hide();
|
||||||
} else {
|
} else {
|
||||||
|
@ -42,17 +42,17 @@ exports.create = function (win, config) {
|
||||||
const contextMenu = Menu.buildFromTemplate([
|
const contextMenu = Menu.buildFromTemplate([
|
||||||
{
|
{
|
||||||
label: 'Show/Hide ' + config.brand,
|
label: 'Show/Hide ' + config.brand,
|
||||||
click: toggleWin
|
click: toggleWin,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'separator'
|
type: 'separator',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: 'Quit',
|
label: 'Quit',
|
||||||
click: function () {
|
click: function() {
|
||||||
app.quit();
|
app.quit();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
trayIcon = new Tray(config.icon_path);
|
trayIcon = new Tray(config.icon_path);
|
||||||
|
|
Loading…
Reference in a new issue