File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 28
28
width : 100% ;
29
29
display : flex;
30
30
-webkit-app-region : drag;
31
- padding-left : 75px ;
32
31
background-color : # f8f8f8 ;
33
32
color : # 484848 ;
34
33
Original file line number Diff line number Diff line change @@ -4,17 +4,23 @@ const path = require('electron').remote.require('path');
4
4
const { ipcRenderer} = require ( 'electron' ) ;
5
5
const { BrowserWindow} = require ( 'electron' ) . remote ;
6
6
const { clipboard} = require ( 'electron' ) ;
7
+ const { createWindow } = require ( './window' ) ;
7
8
8
9
const SERVER_URL = 'https://hackmd.io' ;
9
10
10
- const isDarwin = os . platform ( ) === 'darwin' ;
11
+ const isMac = os . platform ( ) === 'darwin' ;
11
12
12
13
const winOption = {
13
14
width : 1024 ,
14
15
height : 768
15
16
}
16
17
17
18
onload = ( ) => {
19
+ /* inject mac specific styles */
20
+ if ( isMac ) {
21
+ document . querySelector ( 'navbar' ) . style . paddingLeft = '75px' ;
22
+ }
23
+
18
24
if ( window . location . search !== '' ) {
19
25
targetURL = window . location . search . match ( / \? t a r g e t = ( [ ^ ? ] + ) / ) [ 1 ] ;
20
26
} else {
@@ -73,10 +79,6 @@ onload = () => {
73
79
74
80
/* handle _target=blank pages */
75
81
webview . addEventListener ( 'new-window' , ( event ) => {
76
- new BrowserWindow (
77
- ( isDarwin
78
- ? Object . assign ( { } , winOption , { titleBarStyle : 'hidden' } )
79
- : winOption )
80
- ) . loadURL ( `file://${ path . join ( __dirname , `index.html?target=${ event . url } ` ) } ` ) ;
82
+ createWindow ( { url : `file://${ path . join ( __dirname , `index.html?target=${ event . url } ` ) } ` } ) ;
81
83
} ) ;
82
84
}
You can’t perform that action at this time.
0 commit comments