From 0fd9fa1e2ba054fa9ad4a2e30d17d6c8706a244c Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Sat, 28 May 2011 01:23:00 -0700 Subject: [PATCH] The 'Master' Quality DropDownList now controls all quality controls on the page + on the AddNew Series Page. Master DropDown is now a Telerik Dropdown to fit better with the styling. --- NzbDrone.Web/Views/AddSeries/Add.cshtml | 35 ++++++++++++++----------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/NzbDrone.Web/Views/AddSeries/Add.cshtml b/NzbDrone.Web/Views/AddSeries/Add.cshtml index 2727ba080..0db77b131 100644 --- a/NzbDrone.Web/Views/AddSeries/Add.cshtml +++ b/NzbDrone.Web/Views/AddSeries/Add.cshtml @@ -27,13 +27,10 @@ @Html.DisplayText("No Series to Add"); } - @Html.DropDownList("masterDropbox", (SelectList) ViewData["qualities"], - new {style = "width: 100px;", id = "masterDropboxId"}) + @Html.Telerik().DropDownList().Name("masterDropbox").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes( + new {style = "width: 100px; margin-left:5px;"}).ClientEvents(events => events.OnChange("masterChanged")) - @Html.Telerik().DropDownList().Name("tester").BindTo((SelectList) ViewData["qualities"]).HtmlAttributes( - new {style = "width: 100px", @class = "qualityDropbox"}) - - + @foreach (var path in Model) { @@ -47,19 +44,27 @@ var windowElement = $('#Window'); windowElement.data('tWindow').center().open(); - }; + } function closeAddNewSeries() { var window = $('#Window').data("tWindow"); window.close(); } + + function masterChanged() { + var masterQuality = $('#masterDropbox').data("tDropDownList").value(); + + var qualityDropbox = $(".qualityDropbox"); - $("#masterDropboxId").change(function () { - var selectedQuality = $('#masterDropboxId').get(0).selectedIndex; - //$(".qualityDropbox").data("tComboBox").value(selectedQuality); - //$(".qualityDropbox").data("tDropDownList").val(selectedQuality); - - var comboBox = $(".qualityDropbox").data("tDropDownList"); - comboBox.select(selectedQuality); - }); + qualityDropbox.each(function () { + var child = $(this).children("[id^='qualityList']"); + var comboBox = child.data("tDropDownList"); + comboBox.value(masterQuality); + }); + } + + function testValue() { + var comboBox = $('#qualityList_tester').data("tDropDownList"); + comboBox.value('2'); + } \ No newline at end of file