1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

editorTheme: allow header logo/title to be a link

This commit is contained in:
Nick O'Leary 2015-04-22 14:03:42 +01:00
parent c71e76335b
commit 1c1a85dcef
3 changed files with 14 additions and 2 deletions

View File

@ -42,7 +42,6 @@ $headerMenuItemDivider: #464646;
} }
span.logo { span.logo {
pointer-events: none;
float: left; float: left;
margin-top: 5px; margin-top: 5px;
font-size: 30px; font-size: 30px;
@ -56,6 +55,14 @@ span.logo {
img { img {
height: 18px; height: 18px;
} }
a {
color: inherit;
&:hover {
text-decoration: none;
}
}
} }
.header-toolbar { .header-toolbar {

View File

@ -34,7 +34,7 @@
</head> </head>
<body spellcheck="false"> <body spellcheck="false">
<div id="header"> <div id="header">
<span class="logo">{{#header.image}}<img src="{{.}}">{{/header.image}} <span>{{ header.title }}</span></span> <span class="logo">{{#header.url}}<a href="{{.}}">{{/header.url}}{{#header.image}}<img src="{{.}}">{{/header.image}} <span>{{ header.title }}</span>{{#header.url}}</a>{{/header.url}}</span>
<ul class="header-toolbar hide"> <ul class="header-toolbar hide">
<li><a id="btn-sidemenu" class="button" data-toggle="dropdown" href="#"><i class="fa fa-bars"></i></a></li> <li><a id="btn-sidemenu" class="button" data-toggle="dropdown" href="#"><i class="fa fa-bars"></i></a></li>
<ul> <ul>

View File

@ -91,6 +91,11 @@ module.exports = {
if (theme.header) { if (theme.header) {
themeContext.header.title = theme.header.title || themeContext.header.title; themeContext.header.title = theme.header.title || themeContext.header.title;
if (theme.header.hasOwnProperty("url")) {
themeContext.header.url = theme.header.url;
}
if (theme.header.hasOwnProperty("image")) { if (theme.header.hasOwnProperty("image")) {
if (theme.header.image) { if (theme.header.image) {
url = serveFile(themeApp,"/header/",theme.header.image); url = serveFile(themeApp,"/header/",theme.header.image);