diff --git a/Core/FormNotification.cs b/Core/FormNotification.cs index eba25ecd..b08deaec 100644 --- a/Core/FormNotification.cs +++ b/Core/FormNotification.cs @@ -71,14 +71,15 @@ public void ShowNotification(TweetNotification notification){ } } - public void ShowNotificationForSettings(bool resetAnimation){ + public void ShowNotificationForSettings(bool reset){ if (browser.Address == "about:blank"){ browser.Load("about:blank"); // required, otherwise shit breaks - browser.LoadHtml(TweetNotification.ExampleTweet.GenerateHtml(),"http://tweetdeck.twitter.com/"); - resetAnimation = true; + reset = true; } + + if (reset){ + browser.LoadHtml(TweetNotification.ExampleTweet.GenerateHtml(),"http://tweetdeck.twitter.com/"); - if (resetAnimation){ totalTime = timeLeft = TweetNotification.ExampleTweet.GetDisplayDuration(Program.UserConfig.NotificationDuration); timerProgress.Start(); } diff --git a/Core/Handling/TweetNotification.cs b/Core/Handling/TweetNotification.cs index b2215273..2ee975ce 100644 --- a/Core/Handling/TweetNotification.cs +++ b/Core/Handling/TweetNotification.cs @@ -70,7 +70,7 @@ public int GetDisplayDuration(Duration modifier){ public string GenerateHtml(){ StringBuilder build = new StringBuilder(); build.Append("<!DOCTYPE html>"); - build.Append("<html class='os-windows ").Append(FontSizeClass).Append("'>"); + build.Append("<html class='os-windows txt-base-").Append(FontSizeClass).Append("'>"); build.Append("<head>").Append(HeadTag).Append("</head>"); build.Append("<body class='hearty'><div class='app-columns-container'><div class='column' style='width:100%'>"); build.Append(html); diff --git a/Resources/code.js b/Resources/code.js index df6e2067..f0b7a04e 100644 --- a/Resources/code.js +++ b/Resources/code.js @@ -9,11 +9,6 @@ // var isInitialized = false; - // - // Variable: Previous font size class in the <html> tag. - // - var prevFontSizeClass; - // // Function: Initializes TweetD*ck events. Called after the website app is loaded. // @@ -67,6 +62,7 @@ }; // Finish init + $TD.loadFontSizeClass(TD.settings.getFontSize()); isInitialized = true; }; @@ -192,16 +188,8 @@ // // Block: Observe changes in <html> class to update font size. // - new MutationObserver(function(mutations){ - var fsClass = getFontSizeClass(); - - if (fsClass != prevFontSizeClass){ - prevFontSizeClass = fsClass; - $TD.loadFontSizeClass(fsClass); - } - }).observe(document.documentElement,{ - attributes: true, - attributeFilter: [ "class" ] + TD.settings.setFontSize = extendFunction(TD.settings.setFontSize,function(name){ + $TD.loadFontSizeClass(name); }); //