Skip to content

Commit

Permalink
Merge pull request #14 from swisspush/fix-home-button-link
Browse files Browse the repository at this point in the history
Fix home button link
  • Loading branch information
matthiasbaldi authored Jan 23, 2019
2 parents 6be0aa0 + 1376068 commit c03034b
Show file tree
Hide file tree
Showing 6 changed files with 3,331 additions and 1,594 deletions.
9 changes: 3 additions & 6 deletions app/js/tree.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
'use strict';

// initially set home button path
document.getElementById("home-button").href = settings.homeUrl;

function paramSelected(value) {
var selected = getParameterByName('selected');
var treeBase = getParameterByName('treeBase');
Expand Down Expand Up @@ -30,10 +33,6 @@ function paramSelected(value) {

var autoExpandToAndSelectPath = paramSelected();

function goHome() {
window.location.href = settings.homeUrl;
}

function findNodesByUrl(searchUrl) {
var nodes = [];
var jstree = $('#tree').jstree();
Expand Down Expand Up @@ -662,7 +661,6 @@ function toggleEditModeClicked() {
// start editor, either in Edit-Mode or in Raw-Mode
function openInEditor(url) {
if (currentUrlInEditor) {
console.info('closing');
$('#editor-iframe').attr('src', '');
$('#empty-editor-placeholder').fadeTo(400,1);
}
Expand All @@ -675,7 +673,6 @@ function openInEditor(url) {
}
if (url) {
window.setTimeout(function () {
console.info('opening '+url);
$('#editor-iframe').attr('src', url);
$('#empty-editor-placeholder').fadeTo(1,0);
}, 10);
Expand Down
5 changes: 3 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
<div class="tree-wrapper">
<div id="treeResizable">
<div class="button-bar">
<button class="ui-button ui-widget ui-corner-all" title="Home" onclick="goHome()">
<!-- href will be set dynamically in tree.js -->
<a class="ui-button ui-widget ui-corner-all" title="Home" href="" id="home-button">
<i class="fa fa-home"></i>
</button>
</a>
<label for="edit-mode-toggler" style="margin: 0" title="Toggle Edit / Raw "><i class="fa fa-pencil"></i></label>
<input type="checkbox" id="edit-mode-toggler" onchange="toggleEditModeClicked()"/>
</div>
Expand Down
Loading

0 comments on commit c03034b

Please sign in to comment.