File tree Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Expand file tree Collapse file tree 3 files changed +28
-4
lines changed Original file line number Diff line number Diff line change @@ -78,3 +78,15 @@ navbar.unsupported {
7878# navbar-container .control-buttons > * : hover {
7979 color : # c1c1c1 ;
8080}
81+
82+ # navbar-container .control-buttons > .pin-window {
83+ margin-right : 5px ;
84+ font-size : 0.9em ;
85+ padding-bottom : 2px ;
86+ transform : rotate (-45deg );
87+ transition : transform .5s ;
88+ }
89+
90+ # navbar-container .control-buttons > .pin-window .pinned {
91+ transform : rotate (0 );
92+ }
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ <h4 class="modal-title">Customize HackMD server</h4>
3131 < navbar >
3232 < div id ="navbar-container ">
3333 < div class ="control-buttons ">
34+ < div class ="pin-window "> < i class ="fa fa-map-pin " aria-hidden ="true "> </ i > </ div >
3435 < div class ="home "> HOME</ div >
3536 < div class ="refresh "> REFRESH</ div >
3637 < div class ="navigate-back " style ="margin: 0 1em; "> <</ div >
Original file line number Diff line number Diff line change 11const { ipcRenderer, remote, clipboard } = require ( 'electron' )
2- const { BrowserWindow , Menu } = remote
2+ const { Menu } = remote
33
44const os = remote . require ( 'os' )
55const path = remote . require ( 'path' )
@@ -88,21 +88,32 @@ window.onload = () => {
8888 }
8989
9090 document . querySelector ( '#navbar-container .minimize-window' ) . onclick = ( ) => {
91- const win = BrowserWindow . getFocusedWindow ( )
91+ const win = remote . getCurrentWindow ( )
9292 win . minimize ( )
9393 }
9494
9595 document . querySelector ( '#navbar-container .toggle-window' ) . onclick = ( ) => {
96- const win = BrowserWindow . getFocusedWindow ( )
96+ const win = remote . getCurrentWindow ( )
9797 if ( win . isMaximized ( ) ) {
9898 win . unmaximize ( )
9999 } else {
100100 win . maximize ( )
101101 }
102102 }
103103
104+ $ ( '#navbar-container .pin-window' ) . click ( function ( ) {
105+ const win = remote . getCurrentWindow ( )
106+ if ( win . isAlwaysOnTop ( ) ) {
107+ win . setAlwaysOnTop ( false )
108+ $ ( this ) . removeClass ( 'pinned' )
109+ } else {
110+ win . setAlwaysOnTop ( true )
111+ $ ( this ) . addClass ( 'pinned' )
112+ }
113+ } )
114+
104115 document . querySelector ( '#navbar-container .close-window' ) . onclick = ( ) => {
105- const win = BrowserWindow . getFocusedWindow ( )
116+ const win = remote . getCurrentWindow ( )
106117 win . close ( )
107118 }
108119
You can’t perform that action at this time.
0 commit comments