-
Notifications
You must be signed in to change notification settings - Fork 0
/
sidebar.php
52 lines (45 loc) · 1.47 KB
/
sidebar.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<div class="sidebar col-xs-4">
<ul>
<li>
<a href="/smarthome/index.php" id="home-link">
<i class="fa fa-home"></i>
Home
</a>
</li>
<li>
<a href="/smarthome/installation.php" id="installation-link">
<i class="fa fa-plus-square"></i>
Installation
</a>
</li>
<li>
<a href="/smarthome/viewDevices.php" id="devices-link">
<i class="fa fa-tablet"></i>
Devices
</a>
</li>
<li>
<a href="/smarthome/setup.php" id="setup-link">
<i class="fa fa-cog"></i>
Setup
</a>
</li>
</ul>
</div>
<script type="text/javascript">
function setSelectedLink() {
var link;
var pathName = window.location.pathname;
if (pathName.indexOf('index') > -1) {
link = document.getElementById('home-link');
} else if (pathName.indexOf('installation') > -1) {
link = document.getElementById('installation-link');
} else if (pathName.indexOf('Devices') > -1) {
link = document.getElementById('devices-link');
} else if(pathName.indexOf('setup') > -1) {
link = document.getElementById('setup-link');
}
link.className = 'selected';
}
setSelectedLink();
</script>