From a764f8e99916a4264d41de1956ca2ce2325b2238 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Sat, 16 Jun 2012 16:03:19 +0200 Subject: [PATCH] Fix the style switcher in a way that is standard conformant *and* working --- html/force.js | 10 ++++++---- html/nodes.html | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/html/force.js b/html/force.js index b29bf7c..56a3f15 100644 --- a/html/force.js +++ b/html/force.js @@ -5,13 +5,15 @@ function switch_style(s) { for (var i = 0; i < el.length; i++ ) { if (el[i].getAttribute("rel").indexOf("style") != -1 && el[i].getAttribute("title")) { - if (el[i].getAttribute("title") == s) { - style_btn.text(s) + /* always set to true first to workaround Chrome bug */ + el[i].disabled = true + + if (el[i].getAttribute("title") == s) el[i].disabled = false - } else - el[i].disabled = true } } + + style_btn.text(s) } function getOffset( el ) { diff --git a/html/nodes.html b/html/nodes.html index ebf204e..e91eccf 100644 --- a/html/nodes.html +++ b/html/nodes.html @@ -5,7 +5,7 @@ Freifunk Lübeck - Knotengraph - +