Skip to content

Commit

Permalink
design: Add back button in left-sidebar.
Browse files Browse the repository at this point in the history
Fixes: #208.
  • Loading branch information
abhigyank authored and akashnimare committed Feb 14, 2018
1 parent 0c1cd96 commit 6d213c8
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion app/main/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ class AppMenu {

static sendAction(action, ...params) {
const win = BrowserWindow.getAllWindows()[0];

if (process.platform === 'darwin') {
win.restore();
}
Expand Down
2 changes: 2 additions & 0 deletions app/renderer/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,7 @@ webview:focus {

/* Tooltip styling */

#back-tooltip,
#reload-tooltip,
#setting-tooltip {
font-family: sans-serif;
Expand All @@ -262,6 +263,7 @@ webview:focus {
font-size: 14px;
}

#back-tooltip:after,
#reload-tooltip:after,
#setting-tooltip:after {
content: " ";
Expand Down
6 changes: 6 additions & 0 deletions app/renderer/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ class ServerManagerView {
this.$reloadButton = $actionsContainer.querySelector('#reload-action');
this.$settingsButton = $actionsContainer.querySelector('#settings-action');
this.$webviewsContainer = document.getElementById('webviews-container');
this.$backButton = $actionsContainer.querySelector('#back-action');

this.$addServerTooltip = document.getElementById('add-server-tooltip');
this.$reloadTooltip = $actionsContainer.querySelector('#reload-tooltip');
this.$settingsTooltip = $actionsContainer.querySelector('#setting-tooltip');
this.$serverIconTooltip = document.getElementsByClassName('server-tooltip');
this.$backTooltip = $actionsContainer.querySelector('#back-tooltip');

this.$sidebar = document.getElementById('sidebar');

Expand Down Expand Up @@ -159,6 +161,9 @@ class ServerManagerView {
this.$settingsButton.addEventListener('click', () => {
this.openSettings('General');
});
this.$backButton.addEventListener('click', () => {
this.tabs[this.activeTabIndex].webview.back();
});

const $serverImgs = document.querySelectorAll('.server-icons');
$serverImgs.forEach($serverImg => {
Expand All @@ -170,6 +175,7 @@ class ServerManagerView {
this.sidebarHoverEvent(this.$addServerButton, this.$addServerTooltip);
this.sidebarHoverEvent(this.$settingsButton, this.$settingsTooltip);
this.sidebarHoverEvent(this.$reloadButton, this.$reloadTooltip);
this.sidebarHoverEvent(this.$backButton, this.$backTooltip);
}

getTabIndex() {
Expand Down
4 changes: 4 additions & 0 deletions app/renderer/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
<i class="material-icons md-48">refresh</i>
<span id="reload-tooltip" style="display:none">Reload</span>
</div>
<div class="action-button" id="back-action">
<i class="material-icons md-48">arrow_back</i>
<span id="back-tooltip" style="display:none">Go Back</span>
</div>
<div class="action-button" id="settings-action">
<i class="material-icons md-48">settings</i>
<span id="setting-tooltip" style="display:none">Settings</span>
Expand Down

0 comments on commit 6d213c8

Please sign in to comment.