mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 02:37:08 -07:00
Added jquery.unobtrusive-ajax for Ajax Helpers, much cleaner HTML and no jQuery work-around required.
Fix: Ajax Links are working again.
This commit is contained in:
parent
4a55d08130
commit
8b9cb7b8ff
22 changed files with 381 additions and 48 deletions
|
@ -11,6 +11,21 @@ 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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue