onContextmenu(cm, e) { e.stopPropagation(); e.preventDefault(); this.menu = Menu.buildFromTemplate(this.getPopupMenu()); this.menu.popup(remote.getCurrentWindow()); }
function isFocused() { return remote.getCurrentWindow().isFocused(); }
var parent = remote.getCurrentWindow(); var dimensions = parent.getSize(); var session = remote.session;
this.savePreferencesButton.addEventListener('click', () => { config.set('sendAnalytics', self.sendAnalyticsCheckbox.checked); config.set('notify.unread', self.notifyUnread.checked); config.set('notify.snoozed', self.notifySnoozed.checked); config.set('notify.download', self.notifyDownload.checked); config.set('notify.period', parseFloat(self.notifyPeriod.value)); remote.getCurrentWindow().close(); });
open(event) { this.event = event; if (!onNavigationEvent(event)) return; menu.popup(remote.getCurrentWindow()); }
_onContextMenu(event) { event.preventDefault(); const chat = this._findVisibleChat(); if(!chat) { return; } const menu = require('../../ui/menus/chat-menu.js')(chat); menu.popup(remote.getCurrentWindow()); }
function onContextMenu(e) { if (menu === null) { menu = inpectElementMenu({x: e.x, y: e.y}, ifInspectable(e.target)); } e.preventDefault(); menu.popup(electron.remote.getCurrentWindow()); }
clearCacheButton () { console.log(`clear cache button is clicked`) let win = remote.getCurrentWindow() win.webContents.session.clearCache(() => { win.webContents.session.clearStorageData() alert('cache is cleared') }) }
window.addEventListener('contextmenu', e => { // Only show the context menu in text editors. if (!e.target.closest('textarea, input, [contenteditable="true"],section')) return; var menu = buildEditorContextMenu(); // The 'contextmenu' event is emitted after 'selectionchange' has fired but possibly before the // visible selection has changed. Try to wait to show the menu until after that, otherwise the // visible selection will update after the menu dismisses and look weird. setTimeout(() => { menu.popup(remote.getCurrentWindow()); }, 30); });
_onContextMenu(event) { event.preventDefault(); const menu = require('../../ui/menus/friends-menu.js')(this.props.user); menu.popup(remote.getCurrentWindow()); }
dialog.showMessageBox(remote.getCurrentWindow(), opts, (idx) => { if (opts.buttons.length === 2 && idx === 0) { $scope.delete(); } });
function saveAndClose () { ipc.send('saveOptions', optionsObj) remote.getCurrentWindow().close() }
_onClick() { const menu = require('../../ui/menus/current-user-menu.js')(this.props.user); menu.popup(remote.getCurrentWindow()); }
function inpectMenuTemplate(pos, elm) { return { label: 'Inspect element', click: () => (elm || electron.remote.getCurrentWindow()).inspectElement(pos.x, pos.y) }; }
_onClick() { const menu = require('../../ui/menus/notifications-menu.js')(this.state.notifications); menu.popup(remote.getCurrentWindow()); }