From 4937b79a7a4f08494eb4e03d1d341b63ba25ff3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCbschle-Schneider?= Date: Thu, 9 Feb 2017 10:10:08 +0100 Subject: [PATCH] Fix fontsize unit fixing (assume px if no unit specified) The settings module sees that we're reading a number, so it converts the value to a number. Unit detection needs a string, though, so convert it back into one in that case. --- js/glowingbear.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/js/glowingbear.js b/js/glowingbear.js index c7ddab8..3301937 100644 --- a/js/glowingbear.js +++ b/js/glowingbear.js @@ -445,6 +445,11 @@ weechat.controller('WeechatCtrl', ['$rootScope', '$scope', '$store', '$timeout', }); // Update font size when changed settings.addCallback('fontsize', function(fontsize) { + if (typeof(fontsize) === "number") { + // settings module recognizes a fontsize without unit it as a number + // and converts, we need to convert back + fontsize = fontsize.toString(); + } // If no unit is specified, it should be pixels if (fontsize.match(/^[0-9]+$/)) { fontsize += 'px';