Skip to content

Commit e31d5a4

Browse files
author
Dave Conway-Jones
committed
Add ability to start page by tab name
1 parent 6bc861c commit e31d5a4

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11

2+
### 3.4.0-beta: Milestone Release
3+
4+
- Add ability to specify to start page by tab name in url
5+
26
### 3.3.1: Maintenance Release
37

48
- Revert to uglify (for now) to fix color-picker failure. Issue #791

dist/dashboard.appcache

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CACHE MANIFEST
2-
# Time: Sat Jan 07 2023 12:01:27 GMT+0000 (Greenwich Mean Time)
2+
# Time: Mon Jan 16 2023 15:11:39 GMT+0000 (Greenwich Mean Time)
33

44
CACHE:
55
i18n.js
@@ -26,4 +26,4 @@ loading.html
2626
NETWORK:
2727
*
2828

29-
# hash: c87d592927da6b8469033d4c196e367228d09d83cff8f1a399fe61d7c0789c7c
29+
# hash: c5a3c8cc25c6fb29b99068967e00294027dd90a7920857e1df25e7d23d869eb5

dist/js/app.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "node-red-dashboard",
3-
"version": "3.3.1",
3+
"version": "3.4.0-beta",
44
"description": "A set of dashboard nodes for Node-RED",
55
"keywords": [
66
"node-red"

src/main.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,19 @@ app.controller('MainController', ['$mdSidenav', '$window', 'UiEvents', '$locatio
128128
var tabIdFromUrlPath = parseInt($location.path().split('/')[1], 10);
129129
if (!isNaN(tabIdFromUrlPath)) {
130130
var menu = main.menu[tabIdFromUrlPath];
131-
if (menu) {
132-
main.open(menu, tabIdFromUrlPath);
133-
}
131+
if (menu) { main.open(menu, tabIdFromUrlPath); }
132+
}
133+
else {
134+
main.menu.forEach(function(e,i) {
135+
if ($location.path().split('/')[1] === e.header) {
136+
var menu = main.menu[i];
137+
if (menu && menu.disabled !== true) {
138+
main.open(menu, i);
139+
main.select(i);
140+
return;
141+
}
142+
}
143+
})
134144
}
135145
});
136146

0 commit comments

Comments
 (0)