Change the displayContent() function so that a the zonename is a bit faded, so we can see the names of the labels better. Closes #28

This commit is contained in:
Mark Schouten 2015-03-11 12:30:29 +01:00
parent 94f722b4d5
commit 88d7ef7d36
2 changed files with 14 additions and 3 deletions

View file

@ -5,6 +5,9 @@ body, html {
background:#ffffff; background:#ffffff;
} }
.lightgrey {
opacity: .6;
}
#wrap { #wrap {
} }
#menu { #menu {

View file

@ -196,10 +196,18 @@ function displayExportIcon(zone) {
return $img; return $img;
} }
function displayContent(fieldName) { function displayContent(fieldName, zone) {
return function(data) { return function(data) {
if (typeof(zone) != 'undefined') {
var rexp = new RegExp("(.*)"+zone);
var label = rexp.exec(data.record[fieldName]);
var lspan = $('<span>').text(label[1]);
var zspan = $('<span class="lightgrey">').text(zone);
return lspan.add(zspan);
} else {
return $('<span>').text(data.record[fieldName]); return $('<span>').text(data.record[fieldName]);
} }
}
} }
function getEpoch() { function getEpoch() {
@ -545,7 +553,7 @@ $(document).ready(function () {
title: 'Label', title: 'Label',
width: '7%', width: '7%',
create: true, create: true,
display: displayContent('name'), display: displayContent('name', zone.record.name),
inputClass: 'name', inputClass: 'name',
listClass: 'name' listClass: 'name'
}, },