mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-19 04:49:33 -07:00
Made the 'requested' better and made the remove look nicer
This commit is contained in:
parent
754ace42b0
commit
8043cdd527
3 changed files with 18 additions and 30 deletions
|
@ -28,7 +28,7 @@ $(document).on("click", ".delete", function (e) {
|
|||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
|
||||
$("#" + buttonId + "Template").html("");
|
||||
$("#" + buttonId + "Template").slideUp();
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
|
|
|
@ -35,29 +35,10 @@ $(document).on("click", ".dropdownTv", function (e) {
|
|||
data = data + "&latest=true";
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: $form.prop('method'),
|
||||
url: $form.prop('action'),
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
if (response.result === true) {
|
||||
generateNotify("Success!", "success");
|
||||
|
||||
$('#' + buttonId).html("<i class='fa fa-check'></i> Requested <span class='caret'></span>");
|
||||
$('#' + buttonId).removeClass("btn-primary");
|
||||
$('#' + buttonId).addClass("btn-success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
}
|
||||
},
|
||||
error: function (e) {
|
||||
console.log(e);
|
||||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
var type = $form.prop('method');
|
||||
var url = $form.prop('action');
|
||||
|
||||
sendRequestAjax(data, type, url, buttonId);
|
||||
});
|
||||
|
||||
// Click Request for movie
|
||||
|
@ -66,10 +47,18 @@ $(document).on("click", ".requestMovie", function (e) {
|
|||
var buttonId = e.target.id;
|
||||
var $form = $('#form' + buttonId);
|
||||
|
||||
var type = $form.prop('method');
|
||||
var url = $form.prop('action');
|
||||
var data = $form.serialize();
|
||||
|
||||
sendRequestAjax(data, type, url, buttonId);
|
||||
});
|
||||
|
||||
function sendRequestAjax(data, type, url, buttonId) {
|
||||
$.ajax({
|
||||
type: $form.prop('method'),
|
||||
url: $form.prop('action'),
|
||||
data: $form.serialize(),
|
||||
type: type,
|
||||
url: url,
|
||||
data: data,
|
||||
dataType: "json",
|
||||
success: function (response) {
|
||||
console.log(response);
|
||||
|
@ -78,6 +67,7 @@ $(document).on("click", ".requestMovie", function (e) {
|
|||
|
||||
$('#' + buttonId).html("<i class='fa fa-check'></i> Requested");
|
||||
$('#' + buttonId).removeClass("btn-primary");
|
||||
$('#' + buttonId).removeAttr("data-toggle");
|
||||
$('#' + buttonId).addClass("btn-success");
|
||||
} else {
|
||||
generateNotify(response.message, "warning");
|
||||
|
@ -88,9 +78,7 @@ $(document).on("click", ".requestMovie", function (e) {
|
|||
generateNotify("Something went wrong!", "danger");
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function movieSearch() {
|
||||
$("#movieList").html("");
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
{{/if_eq}}
|
||||
{{#if_eq type "tv"}}
|
||||
<div class="dropdown">
|
||||
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<button id="{{id}}" class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
<i class="fa fa-plus"></i> Request
|
||||
<span class="caret"></span>
|
||||
</button>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue