diff --git a/NzbDrone.Web/Controllers/EpisodeController.cs b/NzbDrone.Web/Controllers/EpisodeController.cs index 11eb0c52e..c956f1aa7 100644 --- a/NzbDrone.Web/Controllers/EpisodeController.cs +++ b/NzbDrone.Web/Controllers/EpisodeController.cs @@ -14,14 +14,12 @@ namespace NzbDrone.Web.Controllers _jobProvider = jobProvider; } - [HttpPost] public JsonResult Search(int episodeId) { _jobProvider.QueueJob(typeof(EpisodeSearchJob), episodeId); return JsonNotificationResult.Info("Queued"); } - [HttpPost] public JsonResult SearchSeason(int seriesId, int seasonNumber) { _jobProvider.QueueJob(typeof(SeasonSearchJob), seriesId, seasonNumber); diff --git a/NzbDrone.Web/Helpers/LinkHelper.cs b/NzbDrone.Web/Helpers/LinkHelper.cs index af1438715..df6d83245 100644 --- a/NzbDrone.Web/Helpers/LinkHelper.cs +++ b/NzbDrone.Web/Helpers/LinkHelper.cs @@ -11,21 +11,6 @@ namespace NzbDrone.Web.Helpers { public static class LinkHelper { - public static MvcHtmlString ImageActionLink(this AjaxHelper helper, string imageUrl, object imgAttributes, string actionName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) - { - return ImageActionLink(helper, imageUrl, imgAttributes, actionName, null, routeValues, ajaxOptions, htmlAttributes); - } - - public static MvcHtmlString ImageActionLink(this AjaxHelper helper, string imageUrl, object imgAttributes, string actionName, string controllerName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes) - { - var builder = new TagBuilder("img"); - builder.MergeAttribute("src", imageUrl); - var imgAttributesDictionary = new RouteValueDictionary(imgAttributes); - builder.MergeAttributes(imgAttributesDictionary); - var link = helper.ActionLink("[replaceme]", actionName, controllerName, routeValues, ajaxOptions, htmlAttributes).ToHtmlString(); - return new MvcHtmlString(link.Replace("[replaceme]", builder.ToString(TagRenderMode.SelfClosing))); - } - public static MvcHtmlString ImageActionLink(this HtmlHelper helper, string imageUrl, object imgAttributes, string actionName, object routeValues, object htmlAttributes) { return ImageActionLink(helper, imageUrl, imgAttributes, actionName, null, routeValues, htmlAttributes); diff --git a/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js b/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js index 1e8026218..a8eb52972 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js +++ b/NzbDrone.Web/Scripts/NzbDrone/AutoBind.js @@ -42,4 +42,21 @@ } }); }); +}); + +//Make .ajaxLink use jQuery Ajax for the request + +$(document).on('click', '.ajaxLink', function (event) { + event.preventDefault(); + var onSuccess = $(this).attr('onsuccess'); + $.ajax({ + url: this.href, + cache: false, + success: function () { + if (onSuccess) { + window[onSuccess](); + } + } + }); + return false; }); \ No newline at end of file diff --git a/NzbDrone.Web/Scripts/NzbDrone/grid.js b/NzbDrone.Web/Scripts/NzbDrone/grid.js index 481c5482a..7095a0f28 100644 --- a/NzbDrone.Web/Scripts/NzbDrone/grid.js +++ b/NzbDrone.Web/Scripts/NzbDrone/grid.js @@ -1,6 +1,6 @@ /* Click on row, show details */ -$('.seriesTable a, .dataTable a').live('click', function (event) { - if ($(this).attr('onclick')) +$(document).on('click', '.seriesTable a, .dataTable a', function (event) { + if ($(this).hasClass('ajaxLink') || $(this).attr('onclick')) return; event.preventDefault(); @@ -48,8 +48,8 @@ function fnFormatDetails(nTr) { //Create Image function createImageAjaxLink(url, image, alt, title, classes) { - var html = "" + - ""; + var html = '' + + ''; return html; } diff --git a/NzbDrone.Web/Views/History/Index.cshtml b/NzbDrone.Web/Views/History/Index.cshtml index 38b03d05b..73cbde43c 100644 --- a/NzbDrone.Web/Views/History/Index.cshtml +++ b/NzbDrone.Web/Views/History/Index.cshtml @@ -3,8 +3,8 @@ @{ViewBag.Title = "History";} @section ActionMenu{
} @section HeaderContent diff --git a/NzbDrone.Web/Views/Log/Index.cshtml b/NzbDrone.Web/Views/Log/Index.cshtml index 85f9097ab..0f0ec7d2a 100644 --- a/NzbDrone.Web/Views/Log/Index.cshtml +++ b/NzbDrone.Web/Views/Log/Index.cshtml @@ -3,7 +3,7 @@ @{ ViewBag.Title = "Logs";} @section ActionMenu{ } diff --git a/NzbDrone.Web/Views/Missing/Index.cshtml b/NzbDrone.Web/Views/Missing/Index.cshtml index f003520f5..d819df6b5 100644 --- a/NzbDrone.Web/Views/Missing/Index.cshtml +++ b/NzbDrone.Web/Views/Missing/Index.cshtml @@ -9,9 +9,9 @@ } @section ActionMenu{ }