Skip to content

Commit 5215afc

Browse files
committed
Merge branch 'master' into develop
# Conflicts: # package.json
2 parents bbb4421 + dc3df50 commit 5215afc

File tree

6 files changed

+46
-5
lines changed

6 files changed

+46
-5
lines changed

src/public/app.html

+3
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ <h2>Enter your server URL</h2>
6767
</footer>
6868
</div>
6969
</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>
7073

7174
<script src="../app.js"></script>
7275
</body>

src/scripts/menus/window.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { remote } from 'electron';
2+
import webview from '../webview';
23
import servers from '../servers';
34
const isMac = process.platform === 'darwin';
45

@@ -28,6 +29,7 @@ const macWindowTemplate = [
2829
var mainWindow = remote.getCurrentWindow();
2930
mainWindow.show();
3031
servers.clearActive();
32+
webview.showLanding();
3133
}
3234
},
3335
{
@@ -53,6 +55,7 @@ const windowTemplate = [
5355
accelerator: 'Ctrl+N',
5456
click: function () {
5557
servers.clearActive();
58+
webview.showLanding();
5659
}
5760
},
5861
{

src/scripts/start.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,8 @@ export var start = function () {
158158
});
159159

160160
$('.add-server').on('click', function () {
161-
webview.loaded();
162161
servers.clearActive();
162+
webview.showLanding();
163163
});
164164

165165
servers.restoreActive();

src/scripts/webview.js

+6
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,12 @@ class WebView extends EventEmitter {
161161
while (!(item = this.getActive()) === false) {
162162
item.classList.remove('active');
163163
}
164+
document.querySelector('.landing-page').classList.add('hide');
165+
}
166+
167+
showLanding () {
168+
this.loaded();
169+
document.querySelector('.landing-page').classList.remove('hide');
164170
}
165171

166172
setActive (hostUrl) {

src/stylesheets/main.less

+30
Original file line numberDiff line numberDiff line change
@@ -310,4 +310,34 @@ input[type='password'] {
310310
.landing-page {
311311
left: 0;
312312
}
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+
}
313343
}

src/stylesheets/start-page.less

+3-4
Original file line numberDiff line numberDiff line change
@@ -241,9 +241,8 @@ webview.active {
241241
.landing-page {
242242
z-index: 1;
243243
-webkit-app-region: drag;
244-
}
245244

246-
body,
247-
html {
248-
-webkit-app-region: drag;
245+
&.hide {
246+
display: none;
247+
}
249248
}

0 commit comments

Comments
 (0)