HTML5 data attributes for edit/delete

pull/6/head
Mark McDowall 12 years ago
parent 9a006fc702
commit 75090e77bc

@ -67,8 +67,8 @@ $("#seriesDelete").dialog({
$(".editButton").live('click', function () { $(".editButton").live('click', function () {
//Get the SeriesId and Title //Get the SeriesId and Title
var seriesId = parseInt($(this).attr("value")); var seriesId = parseInt($(this).attr("data-series-id"));
var title = $(this).attr("rel"); var title = $(this).attr("data-series-title");
//Set the title of the dialog //Set the title of the dialog
$("#seriesEditor").dialog("option", "title", title); $("#seriesEditor").dialog("option", "title", title);

@ -70,7 +70,7 @@
@section ActionMenu @section ActionMenu
{ {
<ul class="sub-menu"> <ul class="sub-menu">
<li><a class="editButton" value="@Model.SeriesId" rel="@Model.Title" title="Edit series">Edit</a></li> <li><a class="editButton" data-series-id="@Model.SeriesId" data-series-title="@Model.Title" title="Edit series">Edit</a></li>
<li>@Ajax.ActionLink("Force Refresh", "ForceRefresh", "Command", new { seriesId = Model.SeriesId }, null, new { Title = "Refresh episode and series information and scan for new episodes" })</li> <li>@Ajax.ActionLink("Force Refresh", "ForceRefresh", "Command", new { seriesId = Model.SeriesId }, null, new { Title = "Refresh episode and series information and scan for new episodes" })</li>
<li>@Ajax.ActionLink("Search for missing episodes", "BacklogSeries", "Episode", new { seriesId = Model.SeriesId }, null, new { Title = "Search for episodes missing from this series" })</li> <li>@Ajax.ActionLink("Search for missing episodes", "BacklogSeries", "Episode", new { seriesId = Model.SeriesId }, null, new { Title = "Search for episodes missing from this series" })</li>
<li>@Ajax.ActionLink("Rename Episode Files", "RenameSeries", "Episode", new { seriesId = Model.SeriesId }, null, new { Title = "Rename all episode files to match your preferred naming" })</li> <li>@Ajax.ActionLink("Rename Episode Files", "RenameSeries", "Episode", new { seriesId = Model.SeriesId }, null, new { Title = "Rename all episode files to match your preferred naming" })</li>

@ -181,11 +181,8 @@
}, //Episodes }, //Episodes
{ {
sWidth: '50px', "mDataProp": "HasBanner", "bSortable": false, "fnRender": function (row) { sWidth: '50px', "mDataProp": "HasBanner", "bSortable": false, "fnRender": function (row) {
return "<i class='icon-cog editButton gridAction' title = 'Edit Series' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "' ></i> " + return "<i class='icon-cog editButton gridAction' title = 'Edit Series' data-series-id='" + row.aData["SeriesId"] + "' data-series-title='" + row.aData["Title"] + "' ></i> " +
"<i class='icon-remove deleteButton gridAction' title = 'Delete Series' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "'></i>"; "<i class='icon-remove deleteButton gridAction' title = 'Delete Series' data-series-id='" + row.aData["SeriesId"] + "' data-series-title='" + row.aData["Title"] + "'></i>";
return "<img src='../../Content/Images/settings.png' class='editButton gridAction' title = 'Edit Series' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "' />" +
"<img src='../../Content/Images/close.png' class='deleteButton gridAction' title = 'Delete Series' value='" + row.aData["SeriesId"] + "' rel='" + row.aData["Title"] + "'/>";
} }
}, //Commands }, //Commands
{ sWidth: '60px', "mDataProp": "Details", "bSortable": false, "bVisible": false, "fnRender": function (row) { { sWidth: '60px', "mDataProp": "Details", "bSortable": false, "bVisible": false, "fnRender": function (row) {

Loading…
Cancel
Save