inlined method used only once
This commit is contained in:
parent
e18ffa8779
commit
644ae56f4f
11
js/reveal.js
11
js/reveal.js
|
@ -230,18 +230,13 @@ var Reveal = (function(){
|
||||||
function createSingletonNode(container, tagname, classname, innerHTML){
|
function createSingletonNode(container, tagname, classname, innerHTML){
|
||||||
var node = container.querySelector('.' + classname);
|
var node = container.querySelector('.' + classname);
|
||||||
if( !node ){
|
if( !node ){
|
||||||
node = buildNode(tagname, classname, innerHTML);
|
node = document.createElement(tagname);
|
||||||
container.appendChild(node);
|
|
||||||
}
|
|
||||||
return node;
|
|
||||||
}
|
|
||||||
|
|
||||||
function buildNode(tagname, classname, innerHTML){
|
|
||||||
var node = document.createElement(tagname);
|
|
||||||
node.classList.add(classname);
|
node.classList.add(classname);
|
||||||
if(innerHTML !== null){
|
if(innerHTML !== null){
|
||||||
node.innerHTML = innerHTML;
|
node.innerHTML = innerHTML;
|
||||||
}
|
}
|
||||||
|
container.appendChild(node);
|
||||||
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue