ソースを参照

Création nouvelle note dans une nouvelle fenetre

Arthur Brandao 5 年 前
コミット
58fa00fff7
3 ファイル変更3 行追加9 行削除
  1. 2 1
      app/main/function/menu.js
  2. 0 7
      app/render/event.js
  3. 1 1
      app/render/import.js

+ 2 - 1
app/main/function/menu.js

@@ -1,7 +1,8 @@
+const window = require('../../../helper/window');
 const menuFunction = {};
 
 menuFunction.new = function() {
-    mainWindow.webContents.send('new-note');
+    window.new('./app/src/edit.html');
 };
 
 menuFunction.import = function() {

+ 0 - 7
app/render/event.js

@@ -4,13 +4,6 @@ ipcRenderer.on('reset-app', (event, arg) => {
     document.location = 'reset.html';
 });
 
-ipcRenderer.on('new-note', (event, arg) => {
-    const current = document.location.pathname.split('/').pop();
-    if (current !== 'edit.html' || (document.location.search.trim() !== '' && current === 'edit.html')) {
-        document.location = 'edit.html';
-    }
-});
-
 ipcRenderer.on('app-loader', (event, arg) => {
     func.loader();
 });

+ 1 - 1
app/render/import.js

@@ -1,3 +1,3 @@
-const { ipcRenderer, remote} = require('electron');
+const {ipcRenderer, remote} = require('electron');
 const $ = require('jquery');
 const func = require('../render/function');