Use electron-context-menu insted of bare contextmenu.

Fixes #123
This commit is contained in:
Jonas Schwabe
2016-09-04 21:05:28 +02:00
parent b59f501a82
commit 14ee822b0c
4 changed files with 9 additions and 11 deletions

View File

@@ -9,6 +9,7 @@ Release date: TBD
### Improvements ### Improvements
#### All platforms #### All platforms
- Use `electron-context-menu` to have a working and consistent context menu
- Show current channel/team in window title - Show current channel/team in window title
- Changed display of unread messages on the team tabbar, they are now shown as bold text - Changed display of unread messages on the team tabbar, they are now shown as bold text
- Reload only the selected tab and keep its URL on "Reload" and "Clear Cache and Reload". - Reload only the selected tab and keep its URL on "Reload" and "Clear Cache and Reload".

View File

@@ -395,6 +395,10 @@ var MattermostView = React.createClass({
} }
}); });
} }
require('electron-context-menu')({
window: webview
});
}); });
webview.addEventListener('ipc-message', function(event) { webview.addEventListener('ipc-message', function(event) {
@@ -509,12 +513,6 @@ if (config.teams.length === 0) {
window.location = 'settings.html'; window.location = 'settings.html';
} }
var contextMenu = require('./menus/context');
var menu = contextMenu.createDefault();
window.addEventListener('contextmenu', function(e) {
menu.popup(remote.getCurrentWindow());
}, false);
var showUnreadBadgeWindows = function(unreadCount, mentionCount) { var showUnreadBadgeWindows = function(unreadCount, mentionCount) {
const badge = require('./js/badge'); const badge = require('./js/badge');
const sendBadge = function(dataURL, description) { const sendBadge = function(dataURL, description) {

View File

@@ -480,11 +480,9 @@ var TeamListItemNew = React.createClass({
var configFile = remote.getGlobal('config-file'); var configFile = remote.getGlobal('config-file');
var contextMenu = require('./menus/context'); require('electron-context-menu')({
var menu = contextMenu.createDefault(); window: remote.getCurrentWindow()
window.addEventListener('contextmenu', function(e) { });
menu.popup(remote.getCurrentWindow());
}, false);
ReactDOM.render( ReactDOM.render(
<SettingsPage configFile={ configFile } />, <SettingsPage configFile={ configFile } />,

View File

@@ -16,6 +16,7 @@
"dependencies": { "dependencies": {
"auto-launch": "^2.1.0", "auto-launch": "^2.1.0",
"bootstrap": "^3.3.7", "bootstrap": "^3.3.7",
"electron-context-menu": "^0.5.0",
"electron-squirrel-startup": "^1.0.0", "electron-squirrel-startup": "^1.0.0",
"os-locale": "^1.4.0", "os-locale": "^1.4.0",
"react": "^15.3.0", "react": "^15.3.0",