From 276e01166a74543c46af5db32e118e31282abf0b Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Sun, 10 Jul 2011 23:51:13 -0700 Subject: [PATCH] notification tweaks for chrome --- NzbDrone.Web/Scripts/Notification.js | 13 +++++++++---- NzbDrone.Web/Views/Shared/_Layout.cshtml | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/NzbDrone.Web/Scripts/Notification.js b/NzbDrone.Web/Scripts/Notification.js index 5230a3f3d..df626c099 100644 --- a/NzbDrone.Web/Scripts/Notification.js +++ b/NzbDrone.Web/Scripts/Notification.js @@ -1,11 +1,16 @@ -$(document).ready(function () { +$(window).load(function () { var speed = 700; var isShown = false; var currentMessage = ""; - $.doTimeout(500, refreshNotifications); - - + //workaround for the infinite browser load in chrome + if ($.browser.webkit) { + $.doTimeout(1000, refreshNotifications); + } + else { + refreshNotifications(); + } + function refreshNotifications() { $.get('/notification/Comet', { message: currentMessage }, notificationCallback); diff --git a/NzbDrone.Web/Views/Shared/_Layout.cshtml b/NzbDrone.Web/Views/Shared/_Layout.cshtml index f2302b399..ddec906b4 100644 --- a/NzbDrone.Web/Views/Shared/_Layout.cshtml +++ b/NzbDrone.Web/Views/Shared/_Layout.cshtml @@ -61,7 +61,7 @@ background notification @(Html.Telerik().ScriptRegistrar().jQuery(false)) - @RenderSection("Scripts", required: false) +