mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-22 08:46:51 +00:00
improved javascript for code expansion
This commit is contained in:
parent
1eddd60a71
commit
0b744bae5e
@ -1,12 +1,7 @@
|
|||||||
window.addEvent('domready', function() {
|
window.addEvent('domready', function() {
|
||||||
addPreExpanders();
|
$$('div.highlight').each(addExpander);
|
||||||
});
|
});
|
||||||
|
|
||||||
function addPreExpanders(){
|
|
||||||
$$('div.highlight').each(function(div){
|
|
||||||
addExpander(div);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function addExpander(div){
|
function addExpander(div){
|
||||||
new Element('span',{
|
new Element('span',{
|
||||||
html: 'expand »',
|
html: 'expand »',
|
||||||
@ -29,6 +24,6 @@ function toggleExpander(){
|
|||||||
html = 'expand »';
|
html = 'expand »';
|
||||||
}
|
}
|
||||||
$$('div.highlight span.pre_expander').each(function(span){
|
$$('div.highlight span.pre_expander').each(function(span){
|
||||||
span.set('html',html);
|
span.set('html',html);
|
||||||
});
|
});
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user