File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 2828 width : 100% ;
2929 display : flex;
3030 -webkit-app-region : drag;
31- padding-left : 75px ;
3231 background-color : # f8f8f8 ;
3332 color : # 484848 ;
3433
Original file line number Diff line number Diff line change @@ -4,17 +4,23 @@ const path = require('electron').remote.require('path');
44const { ipcRenderer} = require ( 'electron' ) ;
55const { BrowserWindow} = require ( 'electron' ) . remote ;
66const { clipboard} = require ( 'electron' ) ;
7+ const { createWindow } = require ( './window' ) ;
78
89const SERVER_URL = 'https://hackmd.io' ;
910
10- const isDarwin = os . platform ( ) === 'darwin' ;
11+ const isMac = os . platform ( ) === 'darwin' ;
1112
1213const winOption = {
1314 width : 1024 ,
1415 height : 768
1516}
1617
1718onload = ( ) => {
19+ /* inject mac specific styles */
20+ if ( isMac ) {
21+ document . querySelector ( 'navbar' ) . style . paddingLeft = '75px' ;
22+ }
23+
1824 if ( window . location . search !== '' ) {
1925 targetURL = window . location . search . match ( / \? t a r g e t = ( [ ^ ? ] + ) / ) [ 1 ] ;
2026 } else {
@@ -73,10 +79,6 @@ onload = () => {
7379
7480 /* handle _target=blank pages */
7581 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 } ` ) } ` } ) ;
8183 } ) ;
8284}
You can’t perform that action at this time.
0 commit comments