From 4a19b19a3cc2dfac0588ff44f4fd3ccde7940afb Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Wed, 23 Sep 2015 16:55:05 +0200 Subject: Refactor part of the Hesla.display() method to ActivePage.display(). --- hesla.es | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'hesla.es') diff --git a/hesla.es b/hesla.es index 4952662..69b65ef 100644 --- a/hesla.es +++ b/hesla.es @@ -81,20 +81,11 @@ export class Hesla extends ActivePage { /** * Display losungen for given day * - * @param new_date String with ISO formatted date (optional) - * or Number with the relative distance of the day from the date - * currently displayed. - * * Displays the Losungen for the given date (or today if not defined) */ display() { - // first scroll then switch to avoid blinking of the page - window.scroll(0, 0); + super.display(); - var visibleElems = document.getElementsByClassName("visible"); - Array.prototype.forEach.call(visibleElems, function(e) { - e.classList.remove("visible"); - }); console.log("cur_watchword = " + this.cur_watchword); document.getElementById(this.cur_watchword.toISODateString()). classList.add("visible"); -- cgit