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 {
78
78
# navbar-container .control-buttons > * : hover {
79
79
color : # c1c1c1 ;
80
80
}
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>
31
31
< navbar >
32
32
< div id ="navbar-container ">
33
33
< div class ="control-buttons ">
34
+ < div class ="pin-window "> < i class ="fa fa-map-pin " aria-hidden ="true "> </ i > </ div >
34
35
< div class ="home "> HOME</ div >
35
36
< div class ="refresh "> REFRESH</ div >
36
37
< div class ="navigate-back " style ="margin: 0 1em; "> <</ div >
Original file line number Diff line number Diff line change 1
1
const { ipcRenderer, remote, clipboard } = require ( 'electron' )
2
- const { BrowserWindow , Menu } = remote
2
+ const { Menu } = remote
3
3
4
4
const os = remote . require ( 'os' )
5
5
const path = remote . require ( 'path' )
@@ -88,21 +88,32 @@ window.onload = () => {
88
88
}
89
89
90
90
document . querySelector ( '#navbar-container .minimize-window' ) . onclick = ( ) => {
91
- const win = BrowserWindow . getFocusedWindow ( )
91
+ const win = remote . getCurrentWindow ( )
92
92
win . minimize ( )
93
93
}
94
94
95
95
document . querySelector ( '#navbar-container .toggle-window' ) . onclick = ( ) => {
96
- const win = BrowserWindow . getFocusedWindow ( )
96
+ const win = remote . getCurrentWindow ( )
97
97
if ( win . isMaximized ( ) ) {
98
98
win . unmaximize ( )
99
99
} else {
100
100
win . maximize ( )
101
101
}
102
102
}
103
103
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
+
104
115
document . querySelector ( '#navbar-container .close-window' ) . onclick = ( ) => {
105
- const win = BrowserWindow . getFocusedWindow ( )
116
+ const win = remote . getCurrentWindow ( )
106
117
win . close ( )
107
118
}
108
119
You can’t perform that action at this time.
0 commit comments