mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 01:43:37 +00:00
31946c96b3
Fix restore scene exceptions tip over title on displayShow page. Change ajax for a deferred ajax call used for plots tips and scene exception tips. Tweak some tip positions and cleanup calls to be more uniform.
42 lines
1.5 KiB
JavaScript
42 lines
1.5 KiB
JavaScript
$(function () {
|
|
$('.title span').each(function () {
|
|
var match = $(this).parent().attr('id').match(/^scene_exception_(\d+)$/);
|
|
$(this).qtip({
|
|
content: {
|
|
text: function(event, api) {
|
|
// deferred object ensuring the request is only made once
|
|
$.ajax({
|
|
url: $('#sbRoot').val() + '/home/sceneExceptions',
|
|
type: 'GET',
|
|
data: {
|
|
show: match[1]
|
|
}
|
|
})
|
|
.then(function(content) {
|
|
// Set the tooltip content upon successful retrieval
|
|
api.set('content.text', content);
|
|
}, function(xhr, status, error) {
|
|
// Upon failure... set the tooltip content to the status and error value
|
|
api.set('content.text', status + ': ' + error);
|
|
});
|
|
return 'Loading...'; // Set initial text
|
|
}
|
|
},
|
|
show: {
|
|
solo: true
|
|
},
|
|
position: {
|
|
viewport: $(window),
|
|
my: 'left center',
|
|
at: 'right center',
|
|
adjust: {
|
|
y: 0,
|
|
x: 2
|
|
}
|
|
},
|
|
style: {
|
|
classes: 'qtip-rounded qtip-shadow'
|
|
}
|
|
});
|
|
});
|
|
});
|