Skip to content
Snippets Groups Projects
Commit 37f1e132 authored by Elke Kreim's avatar Elke Kreim
Browse files

Remove javascript file

parent de7a95ab
No related branches found
No related tags found
No related merge requests found
/*(function($) {
function changeActionString(current) {
var actionString = getRootWebSitePath() + '/course/view.php?id=' + current.val();
$('#hshcourseform').attr('action', actionString);
}
function setInactive(target) {
target.removeClass('active');
target.removeClass('activeCourseSearch');
}
function setActive(target) {
target.addClass('active');
target.addClass('activeCourseSearch');
}
function getRootWebSitePath() {
var _location = document.location.toString();
var applicationNameIndex = _location.indexOf('/', _location.indexOf('://') + 3);
var applicationName = _location.substring(0, applicationNameIndex) + '/';
var webFolderIndex = _location.indexOf('/', _location.indexOf(applicationName) + applicationName.length);
return _location.substring(0, webFolderIndex);
}
function scrollIntoViewIfNeeded(element) {
var windowSize = window.innerHeight;
var elementPosition = element.getBoundingClientRect();
var elementBottom = elementPosition.bottom;
var elementTop = elementPosition.top;
if (elementBottom > windowSize) {
// Scroll an den unteren Rand des Bildes
element.scrollIntoView({block: "end", behavior: "smooth"});
}
if (elementTop < 0) {
// Scroll an den oberen Rand des Bildes
element.scrollIntoView({block: "start", behavior: "smooth"});
}
}
$('input').keydown(function(e) {
var $listItems = $('.hshcoursesearchlistitem');
var key = e.keyCode;
var $selected = $listItems.filter('.activeCourseSearch');
var $current;
if (key !== 40 && key !== 38 && key !== 13) {
return;
}
setInactive($listItems);
if (key === 38) { // KEY UP
if (!$selected.length || $selected.is(':first-child')) {
$current = $listItems.last();
} else {
$current = $selected.prev();
}
changeActionString($current);
} else if (key === 40) { // KEY DOWN
if (!$selected.length || $selected.is(':last-child')) {
$current = $listItems.eq(0);
} else {
$current = $selected.next();
}
changeActionString($current);
} else if (key === 13) { // KEY ENTER
$current = $selected;
if (isNaN($current.val())) {
$current = $listItems.eq(0);
}
changeActionString($current);
}
setActive($current);
scrollIntoViewIfNeeded($current[0]);
});
}(jQuery));
*/
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment