diff options
author | Christopher Baines <cb15g11@soton.ac.uk> | 2014-09-18 18:37:43 +0100 |
---|---|---|
committer | Christopher Baines <cb15g11@soton.ac.uk> | 2014-09-18 18:39:38 +0100 |
commit | ba2d8c4d8d0c50912867b210a37e501009a71761 (patch) | |
tree | 6c6c7258bf84e2379a8672ec2086caa84547345b /src | |
parent | 7142c385a8869a0e7f80abcfe6694f9c00e99786 (diff) | |
download | leaflet-soton-ba2d8c4d8d0c50912867b210a37e501009a71761.tar leaflet-soton-ba2d8c4d8d0c50912867b210a37e501009a71761.tar.gz |
Use a document fragment, rather than creating a redundant div
Diffstat (limited to 'src')
-rw-r--r-- | src/leaflet-soton.js | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/leaflet-soton.js b/src/leaflet-soton.js index a1f6ea4..8b34aaf 100644 --- a/src/leaflet-soton.js +++ b/src/leaflet-soton.js @@ -1482,7 +1482,7 @@ SELECT * WHERE {\ } function getTemplateWrapper(properties, contentFunction) { - var div = document.createElement("div"); + var documentFragment = new DocumentFragment(); if ('uri' in properties) { var link = document.createElement('a'); @@ -1491,12 +1491,12 @@ SELECT * WHERE {\ link.className = 'ls-popup-uri'; link.textContent = "(Full Information)"; - div.appendChild(link); + documentFragment.appendChild(link); } var title = document.createElement('h2'); title.classList.add("ls-popup-title"); - div.appendChild(title); + documentFragment.appendChild(title); var titleText = ""; @@ -1518,9 +1518,9 @@ SELECT * WHERE {\ var div_inner = document.createElement("div"); div_inner.classList.add("ls-popup-content"); contentFunction(div_inner); - div.appendChild( div_inner ); + documentFragment.appendChild( div_inner ); - return div; + return documentFragment; } var createTabs = function(tabs, container) { |