Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug with highlighting text & drag region on macOS #412

Merged
merged 1 commit into from
Apr 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "rocketchat",
"productName": "Rocket.Chat+",
"description": "Rocket.Chat Native Cross-Platform Desktop Application via Electron.",
"version": "2.6.0",
"version": "2.6.1",
"author": "Rocket.Chat Support <[email protected]>",
"copyright": "© 2016, Rocket.Chat",
"homepage": "https://rocket.chat",
Expand Down
3 changes: 3 additions & 0 deletions src/public/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ <h2>Enter your server URL</h2>
</footer>
</div>
</section>
<div class="drag-region left-nav"></div>
<div class="drag-region right-nav"></div>
<div class="drag-region top-bar"></div>

<script src="../app.js"></script>
</body>
Expand Down
3 changes: 3 additions & 0 deletions src/scripts/menus/window.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { remote } from 'electron';
import webview from '../webview';
import servers from '../servers';
const isMac = process.platform === 'darwin';

Expand Down Expand Up @@ -28,6 +29,7 @@ const macWindowTemplate = [
var mainWindow = remote.getCurrentWindow();
mainWindow.show();
servers.clearActive();
webview.showLanding();
}
},
{
Expand All @@ -53,6 +55,7 @@ const windowTemplate = [
accelerator: 'Ctrl+N',
click: function () {
servers.clearActive();
webview.showLanding();
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ export var start = function () {
});

$('.add-server').on('click', function () {
webview.loaded();
servers.clearActive();
webview.showLanding();
});

servers.restoreActive();
Expand Down
6 changes: 6 additions & 0 deletions src/scripts/webview.js
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@ class WebView extends EventEmitter {
while (!(item = this.getActive()) === false) {
item.classList.remove('active');
}
document.querySelector('.landing-page').classList.add('hide');
}

showLanding () {
this.loaded();
document.querySelector('.landing-page').classList.remove('hide');
}

setActive (hostUrl) {
Expand Down
30 changes: 30 additions & 0 deletions src/stylesheets/main.less
Original file line number Diff line number Diff line change
Expand Up @@ -310,4 +310,34 @@ input[type='password'] {
.landing-page {
left: 0;
}

.drag-region.left-nav {
left: 0;
}
}

.drag-region {
position: absolute;
-webkit-app-region: drag;

&.left-nav {
@media(max-width: 860px) {
width: 20px;
}

width: 260px;
height: 100%;
left: 80px;
}

&.right-nav {
width: 40px;
height: 100%;
right: 0;
}

&.top-bar {
height: 20px;
width: 100%;
}
}
7 changes: 3 additions & 4 deletions src/stylesheets/start-page.less
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,8 @@ webview.active {
.landing-page {
z-index: 1;
-webkit-app-region: drag;
}

body,
html {
-webkit-app-region: drag;
&.hide {
display: none;
}
}