2014-05-26 06:29:22 +00:00
|
|
|
$(function () {
|
2014-11-21 04:41:42 +00:00
|
|
|
$('.title span').each(function () {
|
2014-12-11 12:55:42 +00:00
|
|
|
var match = $(this).parent().attr('id').match(/^scene_exception_(\d+)$/);
|
2014-05-26 06:29:22 +00:00
|
|
|
$(this).qtip({
|
|
|
|
content: {
|
2014-12-11 12:55:42 +00:00
|
|
|
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
|
2014-05-26 06:29:22 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
show: {
|
|
|
|
solo: true
|
|
|
|
},
|
|
|
|
position: {
|
|
|
|
viewport: $(window),
|
2014-12-11 12:55:42 +00:00
|
|
|
my: 'left center',
|
|
|
|
at: 'right center',
|
2014-05-26 06:29:22 +00:00
|
|
|
adjust: {
|
2014-11-21 04:41:42 +00:00
|
|
|
y: 0,
|
2014-12-11 12:55:42 +00:00
|
|
|
x: 2
|
2014-05-26 06:29:22 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
style: {
|
2014-12-11 12:55:42 +00:00
|
|
|
classes: 'qtip-rounded qtip-shadow'
|
2014-05-26 06:29:22 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|