Avoid a Javascript error when @tag is null

As it was pointed out in https://github.com/openSUSE/osem/pull/1142 if
@tag is null there is an error in the Console when trying to take the
user to the current day and time.
This commit is contained in:
Ana María Martínez Gómez 2016-12-21 10:55:56 +01:00
parent 22a3f614a3
commit cc4930c120

View file

@ -61,5 +61,8 @@
// Go to current date and time
$(document).ready(function(){
document.getElementById("#{ @tag }").scrollIntoView();
tag = "#{ @tag }";
if(tag !== ""){
document.getElementById(tag).scrollIntoView();
}
});