Skip to content

Commit

Permalink
Merge pull request #42 from dryabov/master
Browse files Browse the repository at this point in the history
open external links in new window
  • Loading branch information
iShift committed Sep 23, 2014
2 parents 5065f71 + be72159 commit b06389c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions app/js/interface.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@
});
});

/**
* Open external links in new window
*/
win.on('new-win-policy', function (frame, url, policy) {
policy.forceNewWindow();
});

/**
* Disable drag&drop to window
*/
Expand Down
8 changes: 7 additions & 1 deletion app/js/tray.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ window.addEventListener('init', function () {
}),
menuTray = new gui.Menu(),
skipMinimizeToTray = false,
reNewMessages = /^\(\d+\)/,
reNewMessages = /^\((\d+)\)/,
observer,
themeDir = appDir + ds + 'html';

Expand Down Expand Up @@ -164,6 +164,11 @@ window.addEventListener('init', function () {
tray.tooltip = title;
bNewMessages = reNewMessages.test(title);
tray.icon = bNewMessages ? icon_new : icon_normal;
var count = 0;
if (bNewMessages) {
count = title.match(reNewMessages)[1];
}
win.setBadgeLabel(count ? count : '');
} else {
bNewMessages = (title !== '');
}
Expand All @@ -182,6 +187,7 @@ window.addEventListener('init', function () {

addEventListener('updateIframe', function () {
bNewMessages = false;
win.setBadgeLabel('');

var iframedoc = window.getIframeDocument();

Expand Down

0 comments on commit b06389c

Please sign in to comment.