AddSeries javascript fixes.

Add new series now has a drop box for rootdir.
Moved add series javascript to addSeries.js.
This commit is contained in:
Mark McDowall 2011-08-23 13:31:28 -07:00
commit 88525a0b7c
7 changed files with 152 additions and 127 deletions

View file

@ -5,6 +5,26 @@
@{
Layout = null;
}
<style>
.existingSeries
{
border-color: #f2f2f2;
border-width: 1px;
border-style: solid;
background-color: #f2f2f2;
margin: 0px 10px 10px 0px;
padding-left: 10px;
padding-right: 10px;
display: inline-block;
}
.masterQualitySelector
{
left: 202px;
position: relative;
}
</style>
@if (Model.ExistingSeries.Count == 0)
{
<h3 style="color: tomato">
@ -38,59 +58,3 @@ else
</div>
</span>
}
<style>
.existingSeries
{
border-color: #f2f2f2;
border-width: 1px;
border-style: solid;
background-color: #f2f2f2;
margin: 0px 10px 10px 0px;
padding-left: 10px;
padding-right: 10px;
display: inline-block;
}
.masterQualitySelector
{
left: 202px;
position: relative;
}
</style>
<script type="text/javascript">
jQuery(document).ready(function () {
$(".masterQualitySelector").change(function () {
var profileId = $(this).val();
$("#existingSeries").find(".qualitySelector").each(function () {
$(this).val(profileId);
});
});
$(".addExistingButton").click(function () {
var root = $(this).parents(".existingSeries");
var addSeriesUrl = '@Url.Action("AddExistingSeries", "AddSeries")';
var title = $(this).siblings(".seriesLookup").val();
var qualityId = $(this).siblings(".qualitySelector").val();
var path = root.find(".seriesPathValue Label").text();
$.ajax({
type: "POST",
url: addSeriesUrl,
data: jQuery.param({ path: path, seriesName: title, qualityProfileId: qualityId }),
error: function (req, status, error) {
alert("Sorry! We could not add " + path + " at this time. " + error);
},
success: function () {
root.hide('highlight', 'fast');
}
});
});
});
</script>