Commit 70981d94 authored by Aria Givi's avatar Aria Givi

Alle aufklappen/zuklappen funktioniert

parent 53405121
$(function () {
setFocusCreatorActionListeners();
setLabelText();
setKeyListeners();
setDropdownListener();
});
/**
* Sets all action listeners for this page
*/
function setFocusCreatorActionListeners () {
function setKeyListeners () {
$(document).keydown(function(event) {
if ($("input#show-create-focus").is(':checked')) {
if (event.keyCode == 27) {
......@@ -17,3 +19,25 @@ function setFocusCreatorActionListeners () {
});
}
function setDropdownListener() {
$('input:checkbox#toggle-dropdowns').change(
function() {
if($(this).is(':checked')) {
$("#toggle-dropdowns-label").html(t('close-dropdowns'));
$(".focus-dropdown-toggle").prop('checked', true);
} else {
$("#toggle-dropdowns-label").html(t('open-dropdowns'));
$(".focus-dropdown-toggle").prop('checked', false);
}
}
)
}
function setLabelText() {
if($('input:checkbox#toggle-dropdowns').is(':checked')) {
$("#toggle-dropdowns-label").html(t('close-dropdowns'));
} else {
$("#toggle-dropdowns-label").html(t('open-dropdowns'));
}
}
......@@ -21,7 +21,9 @@ var translations = {
'result-saver.deleteAll': '<span class="hidden-xs">Ergebnisse</span> löschen</button>',
'result-saver.save.this': 'ÖFFNEN',
'result-saver.save.newtab': 'IN NEUEM TAB',
'result-saver.save.anonymous': 'ANONYM ÖFFNEN'
'result-saver.save.anonymous': 'ANONYM ÖFFNEN',
'close-dropdowns' : 'Alle zuklappen',
'open-dropdowns' : 'Alle aufklappen'
},
'en': {
......@@ -39,7 +41,9 @@ var translations = {
'result-saver.deleteAll': 'delete <span class="hidden-xs">results</span>',
'result-saver.save.this': 'OPEN',
'result-saver.save.newtab': 'IN NEW TAB',
'result-saver.save.anonymous': 'OPEN ANONYMOUSLY'
'result-saver.save.anonymous': 'OPEN ANONYMOUSLY',
'close-dropdowns' : 'Collapse all',
'open-dropdowns' : 'Expand all'
},
'es': {
......
......@@ -39,8 +39,12 @@
}
}
}
#toggle-dropdowns {
#toggle-dropdowns-label {
cursor: pointer;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.focus-dropdown-toggle {
display: none;
......@@ -52,14 +56,15 @@
}
&:checked {
&~.focus-dropdown-label::after {
content: "🡡";
content: "";
}
}
}
.focus-dropdown-label {
cursor: pointer;
&::after {
font-size: 16px;
content: "🡣";
content: "";
margin-left: 3px;
}
&~.row {
......
......@@ -17,8 +17,8 @@
</div>
</div>
<div class="modal-body">
<input type="hidden" id="toggle-dropdowns">
<label for="toggle=dropdowns" class="js-only"></label>
<input type="checkbox" class="hidden" id="toggle-dropdowns" checked>
<label id="toggle-dropdowns-label" for="toggle-dropdowns" class="js-only"></label>
<form id="customSearchForm" method="GET" action="{{ LaravelLocalization::getLocalizedURL(LaravelLocalization::getCurrentLocale(), "/meta/meta.ger3 ") }}" accept-charset="UTF-8">
<input type="hidden" name="eingabe" value="@if(isset($eingabe)){{$eingabe}}@endif">
<input type="hidden" name="encoding" value="utf8">
......
Markdown is supported
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