Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 304dbb4c rédigé par Kubat's avatar Kubat
Parcourir les fichiers

Toggle dev tools on 'F12'

parent 261ac5ad
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!12Config and signals refactor
......@@ -21,9 +21,11 @@ var client; /* Sub process for the express server */
class Lektor {
constructor() {
this.closed = true;
this.attached = false;
isRunning({ win: 'lektord.exe', linux: 'lektord', mac: 'lektord' }).then(v => {
if (v && config.content.lektord.attach) {
logger.info('main', `Lektord is running! Attach to it`);
this.attached = true;
} else if (v) {
logger.error('error', `Lektord is running and attach mode is disable, exit!`);
app.quit();
......@@ -171,7 +173,11 @@ app.on('ready', () => {
globalShortcut.register('F12', () => {
var focused = BrowserWindow.getFocusedWindow();
if (focused) {
focused.webContents.openDevTools();
if (!focused.isDevToolsOpened()) {
focused.webContents.openDevTools({ mode: 'detach' });
} else {
focused.webContents.closeDevTools();
}
}
});
});
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter