From 20542265afebfa7ede7569b17207696364282db4 Mon Sep 17 00:00:00 2001 From: q Date: Wed, 31 May 2017 22:50:11 +0300 Subject: [PATCH] narrow window conf --- config.js | 1 + index.html | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/config.js b/config.js index 18474dd..9e315b3 100644 --- a/config.js +++ b/config.js @@ -1,5 +1,6 @@ config.source="example_links.txt"; config.columns=3; +config.narrow=500; // less than N pixels window results in single column config.title="MDLinks"; config.favicon=null; // link to favicon config.css=null; // link to style file diff --git a/index.html b/index.html index 2bbe667..855f55e 100644 --- a/index.html +++ b/index.html @@ -57,6 +57,9 @@ function init() { hitList=search_hits(document.getElementById("filter").value); print_results(hitList); } +function narrow_window() { + return window.innerWidth < config.narrow; +} String.prototype.capitalizeFirstLetter = function() { return this.charAt(0).toUpperCase() + this.slice(1); } @@ -134,7 +137,7 @@ function print_results(hitList) { var cat=0; for (c=0; c