mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-21 05:53:33 -07:00
Font-Awesomed Settings
This commit is contained in:
parent
665e4b9fbf
commit
b5bdda1c63
6 changed files with 46 additions and 33 deletions
|
@ -12,11 +12,22 @@ $(document).on("click", "#addProfile", function (event) {
|
|||
event.preventDefault();
|
||||
});
|
||||
|
||||
function deleteProfile(id) {
|
||||
sendToServer(id);
|
||||
var profileDiv = '#profile_' + id;
|
||||
$(profileDiv).remove();
|
||||
}
|
||||
$(document).on('click', '.delete-profile', function (e) {
|
||||
var container = $(this).closest('.profileSection');
|
||||
var id = $(container).attr('data-profile-id');
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: deleteQualityProfileUrl,
|
||||
data: jQuery.param({ profileId: id }),
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
$(container).remove();
|
||||
removeOption(id);
|
||||
}
|
||||
});
|
||||
|
||||
e.preventDefault();
|
||||
});
|
||||
|
||||
function renameOption(text, value) {
|
||||
$("#DefaultQualityProfileId option[value='" + value + "']").html(text);
|
||||
|
@ -35,23 +46,9 @@ function removeOption(value) {
|
|||
$("#DefaultQualityProfileId option[value='" + value + "']").remove();
|
||||
}
|
||||
|
||||
function sendToServer(id) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: deleteQualityProfileUrl,
|
||||
data: jQuery.param({ profileId: id }),
|
||||
success: function (data, textStatus, jqXHR) {
|
||||
if (data == "ok") {
|
||||
$("#profile_" + id).remove();
|
||||
removeOption(id);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getProfileId(obj) {
|
||||
var parentProfileSection = $(obj).parents('.profileSection');
|
||||
return parentProfileSection.children('.qualityProfileId').val();
|
||||
var parentProfileSection = $(obj).closest('.profileSection');
|
||||
return parentProfileSection.attr('data-profile-id');
|
||||
}
|
||||
|
||||
function getCleanId(obj) {
|
||||
|
@ -61,8 +58,10 @@ function getCleanId(obj) {
|
|||
|
||||
$(document).on('keyup', '.profileName_textbox', function () {
|
||||
var value = $(this).val();
|
||||
|
||||
$(this).closest('.profileSection').find('.titleText').text(value);
|
||||
var profileId = getProfileId(this);
|
||||
$("#title_" + profileId).text(value);
|
||||
|
||||
renameOption(value, profileId);
|
||||
}).keyup();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue