Commit 2c502243 authored by Simon Daron's avatar Simon Daron Committed by fred
Browse files

move style switcher to base.html

parent 37664586
......@@ -25,6 +25,23 @@
</head>
<body id="{{sectionName}}" class="section-{{sectionName}}">
<div id="StyleSwitcher" class="small" style="position:fixed;right:0; top:0em;z-index:3000;width:2.5em;">
<button class="small icon-sign-blank" data-class="style-ff6633" style="color:#ff6633;padding:0;margin:0;"></button>
<button class="small icon-sign-blank" data-class="style-0000ff" style="color:#0000ff;padding:0;margin:0;"></button>
<button class="small icon-sign-blank" data-class="style-333333" style="color:#333333;padding:0;margin:0;"></button>
<button class="small icon-sign-blank" data-class="style-111111" style="color:#ffffff;padding:0;margin:0;"></button>
</div>
<script type="text/javascript">
$(function() {
$('#StyleSwitcher button').on('click',function(e){
e.preventDefault();
$('body').attr('class','').addClass($(this).attr('data-class'));
localStorage['class'] = $(this).attr('data-class');
});
$('#StyleSwitcher button[data-class="'+localStorage['class']+'"]').trigger('click');
});
</script>
<div id="All">
{% block meta %}<div id="metaNav">{% metanav active=sectionName %}</div>{% endblock %}
<div id="Commons">
......
......@@ -25,24 +25,6 @@
<span class="nav-icon icon-search" ></span>
<span class="iconLabel">{% trans 'Search' %}</span>
</a></li>
<li id="StyleSwitcher" class="small">
<button class="small icon-sign-blank" data-class="style-ff6633" style="color:#ff6633;"></button>
<button class="small icon-sign-blank" data-class="style-0000ff" style="color:#0000ff;"></button>
<button class="small icon-sign-blank" data-class="style-3333ff" style="color:#3333ff;"></button>
<button class="small icon-sign-blank" data-class="style-111111" style="color:#ffffff;"></button>
<button class="small icon-sign-blank" data-class="style-ffffff" style="color:#000000;background:white;"></button>
</li>
<script type="text/javascript">
$(function() {
var currentStyle = localStorage['class'];
$('#StyleSwitcher button').on('click',function(e){
e.preventDefault();
$('#All').attr('class','').addClass($(this).attr('data-class'));
localStorage['class'] = $(this).attr('data-class');
});
$('#StyleSwitcher button[data-class="'+currentStyle+'"]').trigger('click');
});
</script>
</ul>
</nav>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment