Browse Source

Added electron-context-menu.

- This must be initialized once in the app itself, which makes the
  context menu work correctly in the main Rambox window.
- Aside from that, each webview needs to be initialized with
  electron-context-menu as well.
- I'm currently running a custom fork with this functionality added
  and everything works exactly as expected.
pull/1074/head
James Riley 8 years ago
parent
commit
c27f5d1771
  1. 3
      app.js
  2. 3
      app/package.json
  3. 2
      app/ux/WebView.js
  4. 3
      package.json

3
app.js

@ -15,6 +15,9 @@ Ext.application({
// auto update logic // auto update logic
const ipc = require('electron').ipcRenderer; const ipc = require('electron').ipcRenderer;
require('electron-context-menu')();
ipc.on('showAbout', function(event, message) { ipc.on('showAbout', function(event, message) {
!Ext.cq1('about') ? Ext.create('Rambox.view.main.About') : ''; !Ext.cq1('about') ? Ext.create('Rambox.view.main.About') : '';
}); });

3
app/package.json

@ -35,6 +35,7 @@
"electron-is-dev": "^0.1.2", "electron-is-dev": "^0.1.2",
"mime": "^1.4.0", "mime": "^1.4.0",
"rimraf": "2.6.1", "rimraf": "2.6.1",
"tmp": "0.0.28" "tmp": "0.0.28",
"electron-context-menu": "0.9.1"
} }
} }

2
app/ux/WebView.js

@ -229,6 +229,8 @@ Ext.define('Rambox.ux.WebView',{
var webview = me.down('component').el.dom; var webview = me.down('component').el.dom;
require('electron-context-menu')({window: webview});
// Google Analytics Event // Google Analytics Event
ga_storage._trackEvent('Services', 'load', me.type, 1, true); ga_storage._trackEvent('Services', 'load', me.type, 1, true);

3
package.json

@ -106,6 +106,7 @@
"electron-is-dev": "^0.1.2", "electron-is-dev": "^0.1.2",
"mime": "^1.4.0", "mime": "^1.4.0",
"rimraf": "2.6.1", "rimraf": "2.6.1",
"tmp": "0.0.28" "tmp": "0.0.28",
"electron-context-menu": "0.9.1"
} }
} }

Loading…
Cancel
Save