Add tooltip to current activity progress bars

This commit is contained in:
JonnyWong16 2016-02-25 21:53:40 -08:00
parent 13438e3e25
commit ddb0f198a9
2 changed files with 13 additions and 11 deletions

View file

@ -217,8 +217,8 @@ DOCUMENTATION :: END
% endif
<div class="dashboard-activity-progress">
<div class="dashboard-activity-progress-bar">
<div class="bufferbar" style="width: ${a['transcode_progress']}%">${a['transcode_progress']}%</div>
<div class="bar" style="width: ${a['progress_percent']}%">${a['progress_percent']}%</div>
<div class="bufferbar" style="width: ${a['transcode_progress']}%" data-toggle="tooltip" title="Transcoder Progress">${a['transcode_progress']}%</div>
<div class="bar" style="width: ${a['progress_percent']}%" data-toggle="tooltip" title="Stream Progress">${a['progress_percent']}%</div>
</div>
</div>
<div class="dashboard-activity-metadata-wrapper">
@ -289,11 +289,13 @@ DOCUMENTATION :: END
});
// Add hover class to dashboard-instance
$('.dashboard-activity-poster').hover(function() {
$('.dashboard-activity-poster, .dashboard-activity-progress-bar').hover(function() {
$(this).closest('.dashboard-instance').addClass('hover');
}, function() {
$(this).closest('.dashboard-instance').removeClass('hover');
});
$('.bar, .bufferbar').tooltip({container: 'body', placement: 'right', delay: 50});
</script>
% else:
<div class="text-muted">Nothing is currently being watched.</div><br>

View file

@ -59,7 +59,6 @@
<%def name="javascriptIncludes()">
<script src="interfaces/default/js/moment-with-locale.js"></script>
<script>
function currentActivityHeader() {
$.ajax({
url: 'get_current_activity_header',
@ -71,7 +70,6 @@
});
}
currentActivityHeader();
setInterval(currentActivityHeader, 15000);
function currentActivity() {
$.ajax({
@ -84,7 +82,12 @@
});
}
currentActivity();
setInterval(currentActivity, 15000);
setInterval(function () {
$('.bar, .bufferbar').tooltip('destroy');
currentActivityHeader();
currentActivity();
}, 15000);
function getHomeStats(days) {
$.ajax({
@ -97,6 +100,7 @@
}
});
}
getHomeStats();
function getLibraryStats() {
$.ajax({
@ -109,6 +113,7 @@
}
});
}
getLibraryStats();
function recentlyAdded() {
var widthVal = $('body').find(".container-fluid").width();
@ -147,11 +152,6 @@
time_format = data.time_format;
}
});
getHomeStats();
getLibraryStats();
</script>
</%def>