File tree 6 files changed +46
-5
lines changed
6 files changed +46
-5
lines changed Original file line number Diff line number Diff line change @@ -67,6 +67,9 @@ <h2>Enter your server URL</h2>
67
67
</ footer >
68
68
</ div >
69
69
</ section >
70
+ < div class ="drag-region left-nav "> </ div >
71
+ < div class ="drag-region right-nav "> </ div >
72
+ < div class ="drag-region top-bar "> </ div >
70
73
71
74
< script src ="../app.js "> </ script >
72
75
</ body >
Original file line number Diff line number Diff line change 1
1
import { remote } from 'electron' ;
2
+ import webview from '../webview' ;
2
3
import servers from '../servers' ;
3
4
const isMac = process . platform === 'darwin' ;
4
5
@@ -28,6 +29,7 @@ const macWindowTemplate = [
28
29
var mainWindow = remote . getCurrentWindow ( ) ;
29
30
mainWindow . show ( ) ;
30
31
servers . clearActive ( ) ;
32
+ webview . showLanding ( ) ;
31
33
}
32
34
} ,
33
35
{
@@ -53,6 +55,7 @@ const windowTemplate = [
53
55
accelerator : 'Ctrl+N' ,
54
56
click : function ( ) {
55
57
servers . clearActive ( ) ;
58
+ webview . showLanding ( ) ;
56
59
}
57
60
} ,
58
61
{
Original file line number Diff line number Diff line change @@ -158,8 +158,8 @@ export var start = function () {
158
158
} ) ;
159
159
160
160
$ ( '.add-server' ) . on ( 'click' , function ( ) {
161
- webview . loaded ( ) ;
162
161
servers . clearActive ( ) ;
162
+ webview . showLanding ( ) ;
163
163
} ) ;
164
164
165
165
servers . restoreActive ( ) ;
Original file line number Diff line number Diff line change @@ -161,6 +161,12 @@ class WebView extends EventEmitter {
161
161
while ( ! ( item = this . getActive ( ) ) === false ) {
162
162
item . classList . remove ( 'active' ) ;
163
163
}
164
+ document . querySelector ( '.landing-page' ) . classList . add ( 'hide' ) ;
165
+ }
166
+
167
+ showLanding ( ) {
168
+ this . loaded ( ) ;
169
+ document . querySelector ( '.landing-page' ) . classList . remove ( 'hide' ) ;
164
170
}
165
171
166
172
setActive ( hostUrl ) {
Original file line number Diff line number Diff line change @@ -310,4 +310,34 @@ input[type='password'] {
310
310
.landing-page {
311
311
left : 0 ;
312
312
}
313
+
314
+ .drag-region.left-nav {
315
+ left : 0 ;
316
+ }
317
+ }
318
+
319
+ .drag-region {
320
+ position : absolute ;
321
+ -webkit-app-region : drag;
322
+
323
+ & .left-nav {
324
+ @media (max-width : 860px ) {
325
+ width : 20px ;
326
+ }
327
+
328
+ width : 260px ;
329
+ height : 100% ;
330
+ left : 80px ;
331
+ }
332
+
333
+ & .right-nav {
334
+ width : 40px ;
335
+ height : 100% ;
336
+ right : 0 ;
337
+ }
338
+
339
+ & .top-bar {
340
+ height : 20px ;
341
+ width : 100% ;
342
+ }
313
343
}
Original file line number Diff line number Diff line change @@ -241,9 +241,8 @@ webview.active {
241
241
.landing-page {
242
242
z-index : 1 ;
243
243
-webkit-app-region : drag;
244
- }
245
244
246
- body ,
247
- html {
248
- -webkit-app-region : drag;
245
+ & .hide {
246
+ display : none ;
247
+ }
249
248
}
You can’t perform that action at this time.
0 commit comments