Added expand button to article page

This commit is contained in:
Georgy Litvinov 2020-11-06 10:39:38 +01:00
parent 07626aec70
commit d49f9382f4

View file

@ -92,6 +92,12 @@ ${scripts.add('<script async type="text/javascript" src="//cdn.plu.mx/widget-pop
<#assign skipThis = propertyGroups.pullProperty("http://xmlns.com/foaf/0.1/firstName")!> <#assign skipThis = propertyGroups.pullProperty("http://xmlns.com/foaf/0.1/firstName")!>
<#assign skipThis = propertyGroups.pullProperty("http://xmlns.com/foaf/0.1/lastName")!> <#assign skipThis = propertyGroups.pullProperty("http://xmlns.com/foaf/0.1/lastName")!>
</#if> </#if>
<div class="expandSwitch">
<label class="switch">Раскрыть статью
<input id="expandlCB" type="checkbox" checked="false" onclick="switchExpand();">
</label>
</div>
<#-- <#--
<#assign issue = propertyGroups.pullProperty("https://litvinovg.pro/text_structures#issue")!> <#assign issue = propertyGroups.pullProperty("https://litvinovg.pro/text_structures#issue")!>
<#if issue.statements?has_content && issue.type == "data"> <#if issue.statements?has_content && issue.type == "data">
@ -249,6 +255,25 @@ for (i = 0; i < coll.length; i++) {
</a> </a>
</span> </span>
</#if> </#if>
<script>
console.log(localStorage.getItem('switchExpand'));
if (localStorage.getItem('switchExpand') === true || localStorage.getItem('switchExpand') === 'true') {
console.log("show html excerpts");
$('.htmlExcerpt').show();
}
function switchExpand(){
var checkBox = document.getElementById("expandlCB");
if (checkBox.checked == true){
$('.htmlExcerpt').show();
localStorage.setItem('switchExpand',true);
} else {
$('.htmlExcerpt').hide();
localStorage.setItem('switchExpand',false);
}
}
</script>
<#if !editable> <#if !editable>
<script> <script>
var title = $('div#titleContainer').width(); var title = $('div#titleContainer').width();