mirror of
https://github.com/ansible/awx.git
synced 2026-01-20 06:01:25 -03:30
Job detail page
Removed malihu POS custom scrollbar widget. Installed new angular directive. Removed the waiting spinner on scroll, replacing it with a subtle, small spinning cog under the scrollbar.
This commit is contained in:
parent
589e5412d6
commit
1b6a4abf1d
@ -101,7 +101,8 @@ angular.module('Tower', [
|
||||
'LogViewerOptionsDefinition',
|
||||
'EventViewerHelper',
|
||||
'JobDetailHelper',
|
||||
'SocketIO'
|
||||
'SocketIO',
|
||||
'lrInfiniteScroll'
|
||||
])
|
||||
|
||||
.constant('AngularScheduler.partials', $basePath + 'lib/angular-scheduler/lib/')
|
||||
|
||||
@ -25,9 +25,9 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
scope.tasks = [];
|
||||
scope.hostResults = [];
|
||||
|
||||
scope.hostResultsMaxRows = 100;
|
||||
scope.hostResultsMaxRows = 10;
|
||||
scope.hostSummariesMaxRows = 100;
|
||||
scope.tasksMaxRows = 100;
|
||||
scope.tasksMaxRows = 20;
|
||||
scope.playsMaxRows = 100;
|
||||
|
||||
scope.liveEventProcessing = true; // control play/pause state of event processing
|
||||
@ -533,36 +533,6 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
}
|
||||
});
|
||||
|
||||
if (scope.removeFixPlaysScroll) {
|
||||
scope.removeFixPlaysScroll();
|
||||
}
|
||||
scope.removeFixPlaysScroll = scope.$on('FixPlaysScroll', function() {
|
||||
$('#plays-table-detail').mCustomScrollbar("update");
|
||||
setTimeout( function() {
|
||||
$('#plays-table-detail').mCustomScrollbar("scrollTo", "bottom");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
if (scope.removeFixTasksScroll) {
|
||||
scope.removeFixTasksScroll();
|
||||
}
|
||||
scope.removeFixTasksScroll = scope.$on('FixTasksScroll', function() {
|
||||
$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
setTimeout( function() {
|
||||
$('#tasks-table-detail').mCustomScrollbar("scrollTo", "bottom");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
if (scope.removeFixHostResultsScroll) {
|
||||
scope.removeFixHostResultsScroll();
|
||||
}
|
||||
scope.removeFixHostResultsScroll = scope.$on('FixHostResultsScroll', function() {
|
||||
$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
setTimeout( function() {
|
||||
$('#hosts-table-detail').mCustomScrollbar("scrollTo", "bottom");
|
||||
}, 500);
|
||||
});
|
||||
|
||||
scope.adjustSize = function() {
|
||||
var height, ww = $(window).width();
|
||||
if (ww < 1240) {
|
||||
@ -593,28 +563,25 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
|
||||
// Detail table height adjusting. First, put page height back to 'normal'.
|
||||
$('#plays-table-detail').height(80);
|
||||
$('#plays-table-detail').mCustomScrollbar("update");
|
||||
//$('#plays-table-detail').mCustomScrollbar("update");
|
||||
$('#tasks-table-detail').height(120);
|
||||
$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
//$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
$('#hosts-table-detail').height(150);
|
||||
$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
//$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
height = $(window).height() - $('#main-menu-container .navbar').outerHeight() - $('#breadcrumb-container').outerHeight() -
|
||||
$('#job-detail-container').outerHeight() - 20;
|
||||
$('#job-detail-container').outerHeight() - $('#job-detail-footer').outerHeight() - 20;
|
||||
if (height > 15) {
|
||||
// there's a bunch of white space at the bottom, let's use it
|
||||
$('#plays-table-detail').height(80 + (height * 0.10));
|
||||
$('#plays-table-detail').mCustomScrollbar("update");
|
||||
$('#tasks-table-detail').height(120 + (height * 0.20));
|
||||
$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
$('#hosts-table-detail').height(150 + (height * 0.70));
|
||||
$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
}
|
||||
// Summary table height adjusting.
|
||||
height = ($('#job-detail-container').height() / 2) - $('#hosts-summary-section .header').outerHeight() -
|
||||
$('#hosts-summary-section .table-header').outerHeight() -
|
||||
$('#summary-search-section').outerHeight() - 20;
|
||||
$('#hosts-summary-table').height(height);
|
||||
$('#hosts-summary-table').mCustomScrollbar("update");
|
||||
//$('#hosts-summary-table').mCustomScrollbar("update");
|
||||
scope.$emit('RefreshCompleted');
|
||||
};
|
||||
|
||||
@ -665,7 +632,7 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
$('#hosts-summary-section .header').outerHeight() -
|
||||
$('#hosts-summary-section .legend').outerHeight();
|
||||
$('#hosts-summary-table').height(height - 50);
|
||||
$('#hosts-summary-table').mCustomScrollbar("update");
|
||||
//$('#hosts-summary-table').mCustomScrollbar("update");
|
||||
|
||||
$('#hide-summary-button').show();
|
||||
|
||||
@ -698,406 +665,6 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
scope.lessStatus = (scope.lessStatus) ? false : true;
|
||||
};
|
||||
|
||||
scope.HostDetailOnTotalScroll = _.debounce(function() {
|
||||
// Called when user scrolls down (or forward in time)
|
||||
var url, mcs = arguments[0];
|
||||
scope.$apply(function() {
|
||||
if ((!scope.liveEventProcessing) && scope.activeTask && scope.hostResults.length) {
|
||||
scope.auto_scroll = true;
|
||||
url = GetBasePath('jobs') + job_id + '/job_events/?parent=' + scope.activeTask + '&';
|
||||
url += (scope.search_all_hosts_name) ? 'host__name__icontains=' + scope.search_all_hosts_name + '&' : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? 'failed=true&' : '';
|
||||
url += 'host__name__gt=' + scope.hostResults[scope.hostResults.length - 1].name + '&host__isnull=false&page_size=' + scope.hostResultsMaxRows + '&order_by=host__name';
|
||||
Wait('start');
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
data.results.forEach(function(row) {
|
||||
var status, status_text;
|
||||
if (row.event === "runner_on_skipped") {
|
||||
status = 'skipped';
|
||||
}
|
||||
else if (row.event === "runner_on_unreachable") {
|
||||
status = 'unreachable';
|
||||
}
|
||||
else {
|
||||
status = (row.failed) ? 'failed' : (row.changed) ? 'changed' : 'successful';
|
||||
}
|
||||
switch(status) {
|
||||
case "successful":
|
||||
status_text = 'OK';
|
||||
break;
|
||||
case "changed":
|
||||
status_text = "Changed";
|
||||
break;
|
||||
case "failed":
|
||||
status_text = "Failed";
|
||||
break;
|
||||
case "unreachable":
|
||||
status_text = "Unreachable";
|
||||
break;
|
||||
case "skipped":
|
||||
status_text = "Skipped";
|
||||
}
|
||||
scope.hostResults.push({
|
||||
id: row.id,
|
||||
status: status,
|
||||
status_text: status_text,
|
||||
host_id: row.host,
|
||||
task_id: row.parent,
|
||||
name: row.event_data.host,
|
||||
created: row.created,
|
||||
msg: ( (row.event_data && row.event_data.res) ? row.event_data.res.msg : '' )
|
||||
});
|
||||
if (scope.hostResults.length > scope.hostResultsMaxRows) {
|
||||
scope.hostResults.shift();
|
||||
}
|
||||
});
|
||||
if (data.next) {
|
||||
// there are more rows. move dragger up, letting user know.
|
||||
setTimeout(function() { $('#hosts-table-detail .mCSB_dragger').css({ top: (mcs.draggerTop - 15) + 'px'}); }, 700);
|
||||
}
|
||||
scope.auto_scroll = false;
|
||||
//rebuildHostResultsMap();
|
||||
Wait('stop');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
|
||||
scope.HostDetailOnTotalScrollBack = _.debounce(function() {
|
||||
// Called when user scrolls up (or back in time)
|
||||
var url, mcs = arguments[0];
|
||||
scope.$apply(function() {
|
||||
if ((!scope.liveEventProcessing) && scope.activeTask && scope.hostResults.length) {
|
||||
scope.auto_scroll = true;
|
||||
url = GetBasePath('jobs') + job_id + '/job_events/?parent=' + scope.activeTask + '&';
|
||||
url += (scope.search_all_hosts_name) ? 'host__name__icontains=' + scope.search_all_hosts_name + '&' : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? 'failed=true&' : '';
|
||||
url += 'host__name__lt=' + scope.hostResults[0].name + '&host__isnull=false&page_size=' + scope.hostResultsMaxRows + '&order_by=-host__name';
|
||||
Wait('start');
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
data.results.forEach(function(row) {
|
||||
var status, status_text;
|
||||
if (row.event === "runner_on_skipped") {
|
||||
status = 'skipped';
|
||||
}
|
||||
else if (row.event === "runner_on_unreachable") {
|
||||
status = 'unreachable';
|
||||
}
|
||||
else {
|
||||
status = (row.failed) ? 'failed' : (row.changed) ? 'changed' : 'successful';
|
||||
}
|
||||
switch(status) {
|
||||
case "successful":
|
||||
status_text = 'OK';
|
||||
break;
|
||||
case "changed":
|
||||
status_text = "Changed";
|
||||
break;
|
||||
case "failed":
|
||||
status_text = "Failed";
|
||||
break;
|
||||
case "unreachable":
|
||||
status_text = "Unreachable";
|
||||
break;
|
||||
case "skipped":
|
||||
status_text = "Skipped";
|
||||
}
|
||||
scope.hostResults.unshift({
|
||||
id: row.id,
|
||||
status: status,
|
||||
status_text: status_text,
|
||||
host_id: row.host,
|
||||
task_id: row.parent,
|
||||
name: row.event_data.host,
|
||||
created: row.created,
|
||||
msg: ( (row.event_data && row.event_data.res) ? row.event_data.res.msg : '' )
|
||||
});
|
||||
if (scope.hostResults.length > scope.hostResultsMaxRows) {
|
||||
scope.hostResults.pop();
|
||||
}
|
||||
});
|
||||
if (data.next) {
|
||||
// there are more rows. move dragger down, letting user know.
|
||||
setTimeout(function() { $('#hosts-table-detail .mCSB_dragger').css({ top: (mcs.draggerTop + 15) + 'px' }); }, 700);
|
||||
}
|
||||
//rebuildHostResultsMap();
|
||||
Wait('stop');
|
||||
scope.auto_scroll = false;
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
|
||||
|
||||
scope.TasksOnTotalScroll = _.debounce(function() {
|
||||
// Called when user scrolls down (or forward in time)
|
||||
var url, mcs = arguments[0];
|
||||
scope.$apply(function() {
|
||||
if ((!scope.liveEventProcessing) && scope.activePlay && scope.tasks.length) {
|
||||
scope.auto_scroll = true;
|
||||
url = scope.job.url + 'job_tasks/?event_id=' + scope.activePlay;
|
||||
url += (scope.search_all_tasks.length > 0) ? '&id__in=' + scope.search_all_tasks.join() : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? '&failed=true' : '';
|
||||
url += '&id__gt=' + scope.tasks[scope.tasks.length - 1].id + '&page_size=' + scope.tasksMaxRows + '&order_by=id';
|
||||
Wait('start');
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
data.results.forEach(function(event, idx) {
|
||||
var end, elapsed, status, status_text;
|
||||
|
||||
if (idx < data.length - 1) {
|
||||
// end date = starting date of the next event
|
||||
end = data[idx + 1].created;
|
||||
}
|
||||
else {
|
||||
// no next event (task), get the end time of the play
|
||||
scope.plays.every(function(p, j) {
|
||||
if (p.id === scope.activePlay) {
|
||||
end = scope.plays[j].finished;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
if (end) {
|
||||
elapsed = GetElapsed({
|
||||
start: event.created,
|
||||
end: end
|
||||
});
|
||||
}
|
||||
else {
|
||||
elapsed = '00:00:00';
|
||||
}
|
||||
|
||||
status = (event.failed) ? 'failed' : (event.changed) ? 'changed' : 'successful';
|
||||
status_text = (event.failed) ? 'Failed' : (event.changed) ? 'Changed' : 'OK';
|
||||
|
||||
scope.tasks.push({
|
||||
id: event.id,
|
||||
play_id: scope.activePlay,
|
||||
name: event.name,
|
||||
status: status,
|
||||
status_text: status_text,
|
||||
status_tip: "Event ID: " + event.id + "<br />Status: " + status_text,
|
||||
created: event.created,
|
||||
modified: event.modified,
|
||||
finished: end,
|
||||
elapsed: elapsed,
|
||||
hostCount: event.host_count, // hostCount,
|
||||
reportedHosts: event.reported_hosts,
|
||||
successfulCount: event.successful_count,
|
||||
failedCount: event.failed_count,
|
||||
changedCount: event.changed_count,
|
||||
skippedCount: event.skipped_count,
|
||||
taskActiveClass: ''
|
||||
});
|
||||
SetTaskStyles({
|
||||
task: scope.tasks[scope.tasks.length - 1]
|
||||
});
|
||||
if (scope.tasks.length > scope.tasksMaxRows) {
|
||||
scope.tasks.shift();
|
||||
}
|
||||
});
|
||||
if (data.next) {
|
||||
// there are more rows. move dragger up, letting user know.
|
||||
setTimeout(function() { $('#tasks-table-detail .mCSB_dragger').css({ top: (mcs.draggerTop - 15) + 'px'}); }, 700);
|
||||
}
|
||||
scope.auto_scroll = false;
|
||||
//rebuildTasksMap();
|
||||
Wait('stop');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
else {
|
||||
scope.auto_scroll_tasks = false;
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
|
||||
scope.TasksOnTotalScrollBack = _.debounce(function() {
|
||||
// Called when user scrolls up (or back in time)
|
||||
var url, mcs = arguments[0];
|
||||
scope.$apply(function() {
|
||||
if ((!scope.liveEventProcessing) && scope.activePlay && scope.tasks.length) {
|
||||
scope.auto_scroll = true;
|
||||
url = scope.job.url + 'job_tasks/?event_id=' + scope.activePlay;
|
||||
url += (scope.search_all_tasks.length > 0) ? '&id__in=' + scope.search_all_tasks.join() : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? '&failed=true' : '';
|
||||
url += '&id__lt=' + scope.tasks[0].id + '&page_size=' + scope.tasksMaxRows + '&order_by=-id';
|
||||
Wait('start');
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
data.results.forEach(function(event, idx) {
|
||||
var end, elapsed, status, status_text;
|
||||
|
||||
if (idx < data.length - 1) {
|
||||
// end date = starting date of the next event
|
||||
end = data[idx + 1].created;
|
||||
}
|
||||
else {
|
||||
// no next event (task), get the end time of the play
|
||||
scope.plays.every(function(p, j) {
|
||||
if (p.id === scope.activePlay) {
|
||||
end = scope.plays[j].finished;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
if (end) {
|
||||
elapsed = GetElapsed({
|
||||
start: event.created,
|
||||
end: end
|
||||
});
|
||||
}
|
||||
else {
|
||||
elapsed = '00:00:00';
|
||||
}
|
||||
|
||||
status = (event.failed) ? 'failed' : (event.changed) ? 'changed' : 'successful';
|
||||
status_text = (event.failed) ? 'Failed' : (event.changed) ? 'Changed' : 'OK';
|
||||
|
||||
scope.tasks.unshift({
|
||||
id: event.id,
|
||||
play_id: scope.activePlay,
|
||||
name: event.name,
|
||||
status: ( (event.failed) ? 'failed' : (event.changed) ? 'changed' : 'successful' ),
|
||||
status_text: ( (event.failed) ? 'Failed' : (event.changed) ? 'Changed' : 'OK' ),
|
||||
status_tip: "Event ID: " + event.id + "<br />Status: " + status_text,
|
||||
created: event.created,
|
||||
modified: event.modified,
|
||||
finished: end,
|
||||
elapsed: elapsed,
|
||||
hostCount: event.host_count,
|
||||
reportedHosts: event.reported_hosts,
|
||||
successfulCount: event.successful_count,
|
||||
failedCount: event.failed_count,
|
||||
changedCount: event.changed_count,
|
||||
skippedCount: event.skipped_count,
|
||||
taskActiveClass: ''
|
||||
});
|
||||
SetTaskStyles({
|
||||
task: scope.tasks[0]
|
||||
});
|
||||
if (scope.tasks.length > scope.tasksMaxRows) {
|
||||
scope.tasks.pop();
|
||||
}
|
||||
});
|
||||
if (data.next) {
|
||||
// there are more rows. move dragger up, letting user know.
|
||||
setTimeout(function() { $('#tasks-table-detail .mCSB_dragger').css({ top: (mcs.draggerTop + 15) + 'px'}); }, 700);
|
||||
}
|
||||
scope.auto_scroll = false;
|
||||
//rebuildTasksMap();
|
||||
Wait('stop');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
});
|
||||
}, 300);
|
||||
|
||||
scope.HostSummaryOnTotalScroll = function(mcs) {
|
||||
var url;
|
||||
if ((!scope.liveEventProcessing) && scope.hosts) {
|
||||
url = GetBasePath('jobs') + job_id + '/job_host_summaries/?';
|
||||
url += (scope.search_all_hosts_name) ? 'host__name__icontains=' + scope.search_all_hosts_name + '&' : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? 'failed=true&' : '';
|
||||
url += 'host__name__gt=' + scope.hosts[scope.hosts.length - 1].name + '&page_size=' + scope.hostSummariesMaxRows + '&order_by=host__name';
|
||||
Wait('start');
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
setTimeout(function() {
|
||||
scope.$apply(function() {
|
||||
data.results.forEach(function(row) {
|
||||
scope.hosts.push({
|
||||
id: row.host,
|
||||
name: row.summary_fields.host.name,
|
||||
ok: row.ok,
|
||||
changed: row.changed,
|
||||
unreachable: row.dark,
|
||||
failed: row.failures
|
||||
});
|
||||
if (scope.hosts.length > scope.hostSummariesMaxRows) {
|
||||
scope.hosts.shift();
|
||||
}
|
||||
});
|
||||
if (data.next) {
|
||||
// there are more rows. move dragger up, letting user know.
|
||||
setTimeout(function() { $('#hosts-summary-table .mCSB_dragger').css({ top: (mcs.draggerTop - 15) + 'px'}); }, 700);
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
Wait('stop');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
scope.HostSummaryOnTotalScrollBack = function(mcs) {
|
||||
var url;
|
||||
if ((!scope.liveEventProcessing) && scope.hosts) {
|
||||
url = GetBasePath('jobs') + job_id + '/job_host_summaries/?';
|
||||
url += (scope.search_all_hosts_name) ? 'host__name__icontains=' + scope.search_all_hosts_name + '&' : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? 'failed=true&' : '';
|
||||
url += 'host__name__lt=' + scope.hosts[0].name + '&page_size=' + scope.hostSummariesMaxRows + '&order_by=-host__name';
|
||||
Wait('start');
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
setTimeout(function() {
|
||||
scope.$apply(function() {
|
||||
data.results.forEach(function(row) {
|
||||
scope.hosts.unshift({
|
||||
id: row.host,
|
||||
name: row.summary_fields.host.name,
|
||||
ok: row.ok,
|
||||
changed: row.changed,
|
||||
unreachable: row.dark,
|
||||
failed: row.failures
|
||||
});
|
||||
if (scope.hosts.length > scope.hostSummariesMaxRows) {
|
||||
scope.hosts.pop();
|
||||
}
|
||||
});
|
||||
if (data.next) {
|
||||
// there are more rows. move dragger down, letting user know.
|
||||
setTimeout(function() { $('#hosts-summary-table .mCSB_dragger').css({ top: (mcs.draggerTop + 15) + 'px' }); }, 700);
|
||||
}
|
||||
});
|
||||
}, 100);
|
||||
Wait('stop');
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
scope.searchAllByHost = function() {
|
||||
if (scope.search_all_hosts_name) {
|
||||
FilterAllByHostName({
|
||||
@ -1190,6 +757,170 @@ function JobDetailController ($location, $rootScope, $scope, $compile, $routePar
|
||||
});
|
||||
};
|
||||
|
||||
scope.tasksScrollDown = function() {
|
||||
// check for more hosts when user scrolls down on host results list...
|
||||
if ((!scope.liveEventProcessing) && scope.activePlay && scope.tasks.length) {
|
||||
var url = scope.job.url + 'job_tasks/?event_id=' + scope.activePlay;
|
||||
url += (scope.search_all_tasks.length > 0) ? '&id__in=' + scope.search_all_tasks.join() : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? '&failed=true' : '';
|
||||
url += '&id__gt=' + scope.tasks[scope.tasks.length - 1].id; //+ '&page_size=' + scope.tasksMaxRows + '&order_by=id';
|
||||
$('#tasksMoreRows').fadeIn();
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
data.results.forEach(function(event, idx) {
|
||||
var end, elapsed, status, status_text;
|
||||
if (idx < data.length - 1) {
|
||||
// end date = starting date of the next event
|
||||
end = data[idx + 1].created;
|
||||
}
|
||||
else {
|
||||
// no next event (task), get the end time of the play
|
||||
scope.plays.every(function(p, j) {
|
||||
if (p.id === scope.activePlay) {
|
||||
end = scope.plays[j].finished;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
});
|
||||
}
|
||||
if (end) {
|
||||
elapsed = GetElapsed({
|
||||
start: event.created,
|
||||
end: end
|
||||
});
|
||||
}
|
||||
else {
|
||||
elapsed = '00:00:00';
|
||||
}
|
||||
|
||||
status = (event.failed) ? 'failed' : (event.changed) ? 'changed' : 'successful';
|
||||
status_text = (event.failed) ? 'Failed' : (event.changed) ? 'Changed' : 'OK';
|
||||
|
||||
scope.tasks.push({
|
||||
id: event.id,
|
||||
play_id: scope.activePlay,
|
||||
name: event.name,
|
||||
status: status,
|
||||
status_text: status_text,
|
||||
status_tip: "Event ID: " + event.id + "<br />Status: " + status_text,
|
||||
created: event.created,
|
||||
modified: event.modified,
|
||||
finished: end,
|
||||
elapsed: elapsed,
|
||||
hostCount: event.host_count, // hostCount,
|
||||
reportedHosts: event.reported_hosts,
|
||||
successfulCount: event.successful_count,
|
||||
failedCount: event.failed_count,
|
||||
changedCount: event.changed_count,
|
||||
skippedCount: event.skipped_count,
|
||||
taskActiveClass: ''
|
||||
});
|
||||
SetTaskStyles({
|
||||
task: scope.tasks[scope.tasks.length - 1]
|
||||
});
|
||||
});
|
||||
$('#tasksMoreRows').fadeOut(400);
|
||||
})
|
||||
.error(function(data, status) {
|
||||
$('#tasksMoreRows').fadeOut(400);
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
scope.hostResultsScrollDown = function() {
|
||||
// check for more hosts when user scrolls down on host results list...
|
||||
if ((!scope.liveEventProcessing) && scope.activeTask && scope.hostResults.length) {
|
||||
var url = GetBasePath('jobs') + job_id + '/job_events/?parent=' + scope.activeTask + '&';
|
||||
url += (scope.search_all_hosts_name) ? 'host__name__icontains=' + scope.search_all_hosts_name + '&' : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? 'failed=true&' : '';
|
||||
url += 'host__name__gt=' + scope.hostResults[scope.hostResults.length - 1].name + '&host__isnull=false&page_size=' +
|
||||
scope.hostResultsMaxRows + '&order_by=host__name';
|
||||
$('#hostResultsMoreRows').fadeIn();
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
data.results.forEach(function(row) {
|
||||
var status, status_text;
|
||||
if (row.event === "runner_on_skipped") {
|
||||
status = 'skipped';
|
||||
}
|
||||
else if (row.event === "runner_on_unreachable") {
|
||||
status = 'unreachable';
|
||||
}
|
||||
else {
|
||||
status = (row.failed) ? 'failed' : (row.changed) ? 'changed' : 'successful';
|
||||
}
|
||||
switch(status) {
|
||||
case "successful":
|
||||
status_text = 'OK';
|
||||
break;
|
||||
case "changed":
|
||||
status_text = "Changed";
|
||||
break;
|
||||
case "failed":
|
||||
status_text = "Failed";
|
||||
break;
|
||||
case "unreachable":
|
||||
status_text = "Unreachable";
|
||||
break;
|
||||
case "skipped":
|
||||
status_text = "Skipped";
|
||||
}
|
||||
scope.hostResults.push({
|
||||
id: row.id,
|
||||
status: status,
|
||||
status_text: status_text,
|
||||
host_id: row.host,
|
||||
task_id: row.parent,
|
||||
name: row.event_data.host,
|
||||
created: row.created,
|
||||
msg: ( (row.event_data && row.event_data.res) ? row.event_data.res.msg : '' )
|
||||
});
|
||||
});
|
||||
$('#hostResultsMoreRows').fadeOut(400);
|
||||
})
|
||||
.error(function(data, status) {
|
||||
$('#hostResultsMoreRows').fadeOut(400);
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
scope.hostSummariesScrollDown = function() {
|
||||
// check for more hosts when user scrolls down on host summaries list...
|
||||
if ((!scope.liveEventProcessing) && scope.hosts) {
|
||||
var url = GetBasePath('jobs') + job_id + '/job_host_summaries/?';
|
||||
url += (scope.search_all_hosts_name) ? 'host__name__icontains=' + scope.search_all_hosts_name + '&' : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? 'failed=true&' : '';
|
||||
url += 'host__name__gt=' + scope.hosts[scope.hosts.length - 1].name + '&page_size=' + scope.hostSummariesMaxRows + '&order_by=host__name';
|
||||
$('#hostSummariesMoreRows').fadeIn();
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
data.results.forEach(function(row) {
|
||||
scope.hosts.push({
|
||||
id: row.host,
|
||||
name: row.summary_fields.host.name,
|
||||
ok: row.ok,
|
||||
changed: row.changed,
|
||||
unreachable: row.dark,
|
||||
failed: row.failures
|
||||
});
|
||||
});
|
||||
$('#hostSummariesMoreRows').fadeOut();
|
||||
})
|
||||
.error(function(data, status) {
|
||||
$('#hostSummariesMoreRows').fadeOut();
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
msg: 'Call to ' + url + '. GET returned: ' + status });
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
JobDetailController.$inject = [ '$location', '$rootScope', '$scope', '$compile', '$routeParams', '$log', 'ClearScope', 'Breadcrumbs', 'LoadBreadCrumbs', 'GetBasePath',
|
||||
|
||||
@ -684,7 +684,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
||||
callback: callback
|
||||
});
|
||||
|
||||
$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
//$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
})
|
||||
.error(function(data) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
@ -692,7 +692,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
||||
});
|
||||
}
|
||||
else {
|
||||
$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
//$('#tasks-table-detail').mCustomScrollbar("update");
|
||||
SelectTask({
|
||||
scope: scope,
|
||||
id: null,
|
||||
@ -753,7 +753,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
||||
url = scope.job.related.job_events + '?parent=' + scope.activeTask + '&';
|
||||
url += (scope.search_all_hosts_name) ? 'host__name__icontains=' + scope.search_all_hosts_name + '&' : '';
|
||||
url += (scope.searchAllStatus === 'failed') ? 'failed=true&' : '';
|
||||
url += 'event__icontains=runner&page_size=' + scope.hostTableRows + '&order_by=host__name';
|
||||
url += 'event__icontains=runner&page_size=' + scope.hostResultsMaxRows + '&order_by=host__name';
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function(data) {
|
||||
@ -798,7 +798,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
||||
if (callback) {
|
||||
scope.$emit(callback);
|
||||
}
|
||||
$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
//$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
})
|
||||
.error(function(data, status) {
|
||||
ProcessErrors(scope, data, status, null, { hdr: 'Error!',
|
||||
@ -809,7 +809,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
||||
if (callback) {
|
||||
scope.$emit(callback);
|
||||
}
|
||||
$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
//$('#hosts-table-detail').mCustomScrollbar("update");
|
||||
}
|
||||
};
|
||||
}])
|
||||
@ -842,7 +842,7 @@ function($rootScope, $log, UpdatePlayStatus, UpdateHostStatus, AddHostResult, Ge
|
||||
status: (event.failed) ? 'failed' : 'successful'
|
||||
});
|
||||
});
|
||||
$('#hosts-summary-table').mCustomScrollbar("update");
|
||||
//$('#hosts-summary-table').mCustomScrollbar("update");
|
||||
if (callback) {
|
||||
scope.$emit(callback);
|
||||
}
|
||||
|
||||
@ -48,6 +48,18 @@
|
||||
line-height: normal;
|
||||
}
|
||||
|
||||
.scroll-spinner {
|
||||
display: none;
|
||||
background-color: transparent;
|
||||
color:#000;
|
||||
float:right;
|
||||
}
|
||||
#hostResultsMoreRows.scroll-spinner {
|
||||
padding-top: 0;
|
||||
position: relative;
|
||||
top: 12px;
|
||||
}
|
||||
|
||||
.failed-hosts {
|
||||
background-color: @failed-hosts-color;
|
||||
}
|
||||
@ -450,6 +462,10 @@ svg text.percent{
|
||||
}
|
||||
}
|
||||
|
||||
.footer-row {
|
||||
height: 20px;
|
||||
}
|
||||
|
||||
@media (max-width: 767px) {
|
||||
#job-detail-container {
|
||||
#job-status-form {
|
||||
|
||||
@ -720,11 +720,13 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
||||
};
|
||||
}])
|
||||
|
||||
/*
|
||||
.directive('awCustomScroll', [ function() {
|
||||
return function(scope, element, attrs) {
|
||||
var theme = (attrs.scrollTheme) ? attrs.scrollTheme : 'dark-thin',
|
||||
//inertia = (attrs.scrollInertia) ? parseInt(attrs.scrollInertia,10) : 500,
|
||||
//inertia = (attrs.scrollInertia) ? parseInt(attrs.scrollInertia,10) : 1000,
|
||||
axis = ($(element).attr('data-scroll-axis')) ? $(element).attr('data-scroll-axis') : 'y';
|
||||
// console.log('setting inertia: ' + inertia);
|
||||
$(element).mCustomScrollbar({
|
||||
advanced:{
|
||||
updateOnContentResize: true
|
||||
@ -734,14 +736,9 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
||||
},
|
||||
axis: axis,
|
||||
theme: theme,
|
||||
//scrollInertia: inertia,
|
||||
mouseWheel: {
|
||||
enable: true,
|
||||
preventDefault: true,
|
||||
normalizeDelta: false
|
||||
},
|
||||
keyboard: {
|
||||
enable: true,
|
||||
scrollAmount: 20
|
||||
enable: true
|
||||
},
|
||||
callbacks: {
|
||||
onTotalScroll: scope[attrs.onTotalScroll],
|
||||
@ -754,7 +751,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Job
|
||||
},
|
||||
});
|
||||
};
|
||||
}])
|
||||
}]) */
|
||||
|
||||
// Toggle switch inspired by http://www.bootply.com/92189
|
||||
.directive('awToggleButton', [ function() {
|
||||
|
||||
1
awx/ui/static/lib/jquery-mousewheel
Submodule
1
awx/ui/static/lib/jquery-mousewheel
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 0f395d8949f937b987f384cc8833c30a0648fd9b
|
||||
@ -1,4 +0,0 @@
|
||||
.DS_Store
|
||||
/npm-debug.log
|
||||
/node_modules
|
||||
/test/browserify/node_modules
|
||||
@ -1,19 +0,0 @@
|
||||
{
|
||||
"bitwise": true,
|
||||
"browser": true,
|
||||
"camelcase": true,
|
||||
"curly": true,
|
||||
"eqeqeq": true,
|
||||
"indent": 4,
|
||||
"jquery" : true,
|
||||
"latedef": true,
|
||||
"noarg": true,
|
||||
"node": true,
|
||||
"noempty": true,
|
||||
"plusplus": false,
|
||||
"quotmark": "single",
|
||||
"strict": false,
|
||||
"trailing": true,
|
||||
"unused": true,
|
||||
"globals": { "define": true, "require": true }
|
||||
}
|
||||
@ -1,137 +0,0 @@
|
||||
# Mouse Wheel ChangeLog
|
||||
|
||||
## 3.1.11
|
||||
|
||||
* Fix version number for package managers...
|
||||
|
||||
## 3.1.10
|
||||
|
||||
* Fix issue with calculating line height when using older versions of jQuery
|
||||
* Add offsetX/Y normalization with setting to turn it off
|
||||
* Cleans up data on teardown
|
||||
|
||||
## 3.1.9
|
||||
|
||||
* Fix bower.json file
|
||||
* Updated how the deltas are adjusted for older mousewheel based events that have deltas that are factors of 120.
|
||||
* Add $.event.special.mousewheel.settings.adjustOldDeltas (defaults to true) to turn off adjusting of old deltas that are factors of 120. You'd turn this off if you want to be as close to native scrolling as possible.
|
||||
|
||||
## 3.1.8
|
||||
|
||||
* Even better handling of older browsers that use a wheelDelta based on 120
|
||||
* And fix version reported by `$.event.special.mousewheel`
|
||||
|
||||
## 3.1.7
|
||||
|
||||
* Better handle the `deltaMode` values 1 (lines) and 2 (pages)
|
||||
* Attempt to better handle older browsers that use a wheelDelta based on 120
|
||||
|
||||
## 3.1.6
|
||||
|
||||
* Deprecating `delta`, `deltaX`, and `deltaY` event handler arguments
|
||||
* Update actual event object with normalized `deltaX `and `deltaY` values (`event.deltaX`, `event.deltaY`)
|
||||
* Add `deltaFactor` to the event object (`event.deltaFactor`)
|
||||
* Handle `> 0` but `< 1` deltas better
|
||||
* Do not fire the event if `deltaX` and `deltaY` are `0`
|
||||
* Better handle different devices that give different `lowestDelta` values
|
||||
* Add `$.event.special.mousewheel.version`
|
||||
* Some clean up
|
||||
|
||||
## 3.1.5
|
||||
|
||||
* Bad release because I did not update the new `$.event.special.mousewheel.version`
|
||||
|
||||
## 3.1.4
|
||||
|
||||
* Always set the `deltaY`
|
||||
* Add back in the `deltaX` and `deltaY` support for older Firefox versions
|
||||
|
||||
## 3.1.3
|
||||
|
||||
* Include `MozMousePixelScroll` in the to fix list to avoid inconsistent behavior in older Firefox
|
||||
|
||||
## 3.1.2
|
||||
|
||||
* Include grunt utilities for development purposes (jshint and uglify)
|
||||
* Include support for browserify
|
||||
* Some basic cleaning up
|
||||
|
||||
## 3.1.1
|
||||
|
||||
* Fix rounding issue with deltas less than zero
|
||||
|
||||
|
||||
## 3.1.0
|
||||
|
||||
* Fix Firefox 17+ issues by using new wheel event
|
||||
* Normalize delta values
|
||||
* Adds horizontal support for IE 9+ by using new wheel event
|
||||
* Support AMD loaders
|
||||
|
||||
|
||||
## 3.0.6
|
||||
|
||||
* Fix issue with delta being 0 in Firefox
|
||||
|
||||
|
||||
## 3.0.5
|
||||
|
||||
* jQuery 1.7 compatibility
|
||||
|
||||
|
||||
## 3.0.4
|
||||
|
||||
* Fix IE issue
|
||||
|
||||
|
||||
## 3.0.3
|
||||
|
||||
* Added `deltaX` and `deltaY` for horizontal scrolling support (Thanks to Seamus Leahy)
|
||||
|
||||
|
||||
## 3.0.2
|
||||
|
||||
* Fixed delta being opposite value in latest Opera
|
||||
* No longer fix `pageX`, `pageY` for older Mozilla browsers
|
||||
* Removed browser detection
|
||||
* Cleaned up the code
|
||||
|
||||
|
||||
## 3.0.1
|
||||
|
||||
* Bad release... creating a new release due to plugins.jquery.com issue :(
|
||||
|
||||
|
||||
## 3.0
|
||||
|
||||
* Uses new special events API in jQuery 1.2.2+
|
||||
* You can now treat `mousewheel` as a normal event and use `.bind`, `.unbind` and `.trigger`
|
||||
* Using jQuery.data API for expandos
|
||||
|
||||
|
||||
## 2.2
|
||||
|
||||
* Fixed `pageX`, `pageY`, `clientX` and `clientY` event properties for Mozilla based browsers
|
||||
|
||||
|
||||
## 2.1.1
|
||||
|
||||
* Updated to work with jQuery 1.1.3
|
||||
* Used one instead of bind to do unload event for clean up
|
||||
|
||||
|
||||
## 2.1
|
||||
|
||||
* Fixed an issue with the unload handler
|
||||
|
||||
|
||||
## 2.0
|
||||
|
||||
* Major reduction in code size and complexity (internals have change a whole lot)
|
||||
|
||||
|
||||
## 1.0
|
||||
|
||||
* Fixed Opera issue
|
||||
* Fixed an issue with children elements that also have a mousewheel handler
|
||||
* Added ability to handle multiple handlers
|
||||
47
awx/ui/static/lib/jquery-mousewheel/Gruntfile.js
vendored
47
awx/ui/static/lib/jquery-mousewheel/Gruntfile.js
vendored
@ -1,47 +0,0 @@
|
||||
module.exports = function(grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
jshint: {
|
||||
options: {
|
||||
jshintrc: '.jshintrc'
|
||||
},
|
||||
all: ['jquery.mousewheel.js']
|
||||
},
|
||||
uglify: {
|
||||
options: {
|
||||
compress: true,
|
||||
mangle: true,
|
||||
preserveComments: 'some',
|
||||
report: 'gzip'
|
||||
},
|
||||
build: {
|
||||
src: 'jquery.mousewheel.js',
|
||||
dest: 'jquery.mousewheel.min.js'
|
||||
}
|
||||
},
|
||||
connect: {
|
||||
server: {
|
||||
options: {
|
||||
hostname: '*',
|
||||
keepalive: true,
|
||||
middleware: function(connect, options) {
|
||||
return [
|
||||
connect.static(options.base),
|
||||
connect.directory(options.base)
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Load the plugin that provides the 'uglify' task.
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
|
||||
// Default task(s).
|
||||
grunt.registerTask('default', ['jshint', 'uglify']);
|
||||
|
||||
};
|
||||
@ -1,20 +0,0 @@
|
||||
Copyright (c) 2013, Brandon Aaron (http://brandon.aaron.sh)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@ -1,85 +0,0 @@
|
||||
# jQuery Mouse Wheel Plugin
|
||||
|
||||
A [jQuery](http://jquery.com/) plugin that adds cross-browser mouse wheel support with delta normalization.
|
||||
|
||||
In order to use the plugin, simply bind the `mousewheel` event to an element.
|
||||
|
||||
It also provides two helper methods called `mousewheel` and `unmousewheel`
|
||||
that act just like other event helper methods in jQuery.
|
||||
|
||||
The event object is updated with the normalized `deltaX` and `deltaY` properties.
|
||||
In addition there is a new property on the event object called `deltaFactor`. Multiply
|
||||
the `deltaFactor` by `deltaX` or `deltaY` to get the scroll distance that the browser
|
||||
has reported.
|
||||
|
||||
Here is an example of using both the bind and helper method syntax:
|
||||
|
||||
```js
|
||||
// using on
|
||||
$('#my_elem').on('mousewheel', function(event) {
|
||||
console.log(event.deltaX, event.deltaY, event.deltaFactor);
|
||||
});
|
||||
|
||||
// using the event helper
|
||||
$('#my_elem').mousewheel(function(event) {
|
||||
console.log(event.deltaX, event.deltaY, event.deltaFactor);
|
||||
});
|
||||
```
|
||||
|
||||
The old behavior of adding three arguments (`delta`, `deltaX`, and `deltaY`) to the
|
||||
event handler is now deprecated and will be removed in later releases.
|
||||
|
||||
|
||||
## The Deltas...
|
||||
|
||||
The combination of Browsers, Operating Systems, and Devices offer a huge range of possible delta values. In fact if the user
|
||||
uses a trackpad and then a physical mouse wheel the delta values can differ wildly. This plugin normalizes those
|
||||
values so you get a whole number starting at +-1 and going up in increments of +-1 according to the force or
|
||||
acceleration that is used. This number has the potential to be in the thousands depending on the device.
|
||||
Check out some of the data collected from users [here](http://mousewheeldatacollector.herokuapp.com/).
|
||||
|
||||
### Getting the scroll distance
|
||||
|
||||
In some use-cases we prefer to have the normalized delta but in others we want to know how far the browser should
|
||||
scroll based on the users input. This can be done by multiplying the `deltaFactor` by the `deltaX` or `deltaY`
|
||||
event property to find the scroll distance the browser reported.
|
||||
|
||||
The `deltaFactor` property was added to the event object in 3.1.5 so that the actual reported delta value can be
|
||||
extracted. This is a non-standard property.
|
||||
|
||||
|
||||
## See it in action
|
||||
[See the tests on Github](http://brandonaaron.github.io/jquery-mousewheel/test).
|
||||
|
||||
## Using with [Browserify](http://browserify.org)
|
||||
|
||||
Support for browserify is baked in.
|
||||
|
||||
```bash
|
||||
npm install jquery-mousewheel
|
||||
npm install jquery-browserify
|
||||
```
|
||||
|
||||
In your server-side node.js code:
|
||||
|
||||
```js
|
||||
var express = require('express');
|
||||
var app = express.createServer();
|
||||
|
||||
app.use(require('browserify')({
|
||||
require : [ 'jquery-browserify', 'jquery-mousewheel' ]
|
||||
}));
|
||||
```
|
||||
|
||||
In your browser-side javascript:
|
||||
|
||||
```js
|
||||
var $ = require('jquery-browserify');
|
||||
require('jquery-mousewheel')($);
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
This plugin is licensed under the [MIT License](LICENSE.txt).
|
||||
|
||||
Copyright (c) 2013 [Brandon Aaron](http://brandon.aaron.sh)
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
"name": "jquery-mousewheel",
|
||||
"version": "3.1.11",
|
||||
"main": "./jquery.mousewheel.js",
|
||||
"ignore": [
|
||||
"*.json",
|
||||
"*.markdown",
|
||||
"*.txt",
|
||||
".*",
|
||||
"Gruntfile.js",
|
||||
"test"
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": ">=1.2.2"
|
||||
}
|
||||
}
|
||||
@ -1,220 +0,0 @@
|
||||
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Version: 3.1.11
|
||||
*
|
||||
* Requires: jQuery 1.2.2+
|
||||
*/
|
||||
|
||||
(function (factory) {
|
||||
if ( typeof define === 'function' && define.amd ) {
|
||||
// AMD. Register as an anonymous module.
|
||||
define(['jquery'], factory);
|
||||
} else if (typeof exports === 'object') {
|
||||
// Node/CommonJS style for Browserify
|
||||
module.exports = factory;
|
||||
} else {
|
||||
// Browser globals
|
||||
factory(jQuery);
|
||||
}
|
||||
}(function ($) {
|
||||
|
||||
var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
|
||||
toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
|
||||
['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
|
||||
slice = Array.prototype.slice,
|
||||
nullLowestDeltaTimeout, lowestDelta;
|
||||
|
||||
if ( $.event.fixHooks ) {
|
||||
for ( var i = toFix.length; i; ) {
|
||||
$.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
|
||||
}
|
||||
}
|
||||
|
||||
var special = $.event.special.mousewheel = {
|
||||
version: '3.1.11',
|
||||
|
||||
setup: function() {
|
||||
if ( this.addEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.addEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = handler;
|
||||
}
|
||||
// Store the line height and page height for this particular element
|
||||
$.data(this, 'mousewheel-line-height', special.getLineHeight(this));
|
||||
$.data(this, 'mousewheel-page-height', special.getPageHeight(this));
|
||||
},
|
||||
|
||||
teardown: function() {
|
||||
if ( this.removeEventListener ) {
|
||||
for ( var i = toBind.length; i; ) {
|
||||
this.removeEventListener( toBind[--i], handler, false );
|
||||
}
|
||||
} else {
|
||||
this.onmousewheel = null;
|
||||
}
|
||||
// Clean up the data we added to the element
|
||||
$.removeData(this, 'mousewheel-line-height');
|
||||
$.removeData(this, 'mousewheel-page-height');
|
||||
},
|
||||
|
||||
getLineHeight: function(elem) {
|
||||
var $parent = $(elem)['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
|
||||
if (!$parent.length) {
|
||||
$parent = $('body');
|
||||
}
|
||||
return parseInt($parent.css('fontSize'), 10);
|
||||
},
|
||||
|
||||
getPageHeight: function(elem) {
|
||||
return $(elem).height();
|
||||
},
|
||||
|
||||
settings: {
|
||||
adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
|
||||
normalizeOffset: true // calls getBoundingClientRect for each event
|
||||
}
|
||||
};
|
||||
|
||||
$.fn.extend({
|
||||
mousewheel: function(fn) {
|
||||
return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
|
||||
},
|
||||
|
||||
unmousewheel: function(fn) {
|
||||
return this.unbind('mousewheel', fn);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function handler(event) {
|
||||
var orgEvent = event || window.event,
|
||||
args = slice.call(arguments, 1),
|
||||
delta = 0,
|
||||
deltaX = 0,
|
||||
deltaY = 0,
|
||||
absDelta = 0,
|
||||
offsetX = 0,
|
||||
offsetY = 0;
|
||||
event = $.event.fix(orgEvent);
|
||||
event.type = 'mousewheel';
|
||||
|
||||
// Old school scrollwheel delta
|
||||
if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
|
||||
if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
|
||||
if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
|
||||
if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
|
||||
|
||||
// Firefox < 17 horizontal scrolling related to DOMMouseScroll event
|
||||
if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
|
||||
deltaX = deltaY * -1;
|
||||
deltaY = 0;
|
||||
}
|
||||
|
||||
// Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
|
||||
delta = deltaY === 0 ? deltaX : deltaY;
|
||||
|
||||
// New school wheel delta (wheel event)
|
||||
if ( 'deltaY' in orgEvent ) {
|
||||
deltaY = orgEvent.deltaY * -1;
|
||||
delta = deltaY;
|
||||
}
|
||||
if ( 'deltaX' in orgEvent ) {
|
||||
deltaX = orgEvent.deltaX;
|
||||
if ( deltaY === 0 ) { delta = deltaX * -1; }
|
||||
}
|
||||
|
||||
// No change actually happened, no reason to go any further
|
||||
if ( deltaY === 0 && deltaX === 0 ) { return; }
|
||||
|
||||
// Need to convert lines and pages to pixels if we aren't already in pixels
|
||||
// There are three delta modes:
|
||||
// * deltaMode 0 is by pixels, nothing to do
|
||||
// * deltaMode 1 is by lines
|
||||
// * deltaMode 2 is by pages
|
||||
if ( orgEvent.deltaMode === 1 ) {
|
||||
var lineHeight = $.data(this, 'mousewheel-line-height');
|
||||
delta *= lineHeight;
|
||||
deltaY *= lineHeight;
|
||||
deltaX *= lineHeight;
|
||||
} else if ( orgEvent.deltaMode === 2 ) {
|
||||
var pageHeight = $.data(this, 'mousewheel-page-height');
|
||||
delta *= pageHeight;
|
||||
deltaY *= pageHeight;
|
||||
deltaX *= pageHeight;
|
||||
}
|
||||
|
||||
// Store lowest absolute delta to normalize the delta values
|
||||
absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
|
||||
|
||||
if ( !lowestDelta || absDelta < lowestDelta ) {
|
||||
lowestDelta = absDelta;
|
||||
|
||||
// Adjust older deltas if necessary
|
||||
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
||||
lowestDelta /= 40;
|
||||
}
|
||||
}
|
||||
|
||||
// Adjust older deltas if necessary
|
||||
if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
|
||||
// Divide all the things by 40!
|
||||
delta /= 40;
|
||||
deltaX /= 40;
|
||||
deltaY /= 40;
|
||||
}
|
||||
|
||||
// Get a whole, normalized value for the deltas
|
||||
delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
|
||||
deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
|
||||
deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
|
||||
|
||||
// Normalise offsetX and offsetY properties
|
||||
if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
|
||||
var boundingRect = this.getBoundingClientRect();
|
||||
offsetX = event.clientX - boundingRect.left;
|
||||
offsetY = event.clientY - boundingRect.top;
|
||||
}
|
||||
|
||||
// Add information to the event object
|
||||
event.deltaX = deltaX;
|
||||
event.deltaY = deltaY;
|
||||
event.deltaFactor = lowestDelta;
|
||||
event.offsetX = offsetX;
|
||||
event.offsetY = offsetY;
|
||||
// Go ahead and set deltaMode to 0 since we converted to pixels
|
||||
// Although this is a little odd since we overwrite the deltaX/Y
|
||||
// properties with normalized deltas.
|
||||
event.deltaMode = 0;
|
||||
|
||||
// Add event and delta to the front of the arguments
|
||||
args.unshift(event, delta, deltaX, deltaY);
|
||||
|
||||
// Clearout lowestDelta after sometime to better
|
||||
// handle multiple device types that give different
|
||||
// a different lowestDelta
|
||||
// Ex: trackpad = 3 and mouse wheel = 120
|
||||
if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
|
||||
nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
|
||||
|
||||
return ($.event.dispatch || $.event.handle).apply(this, args);
|
||||
}
|
||||
|
||||
function nullLowestDelta() {
|
||||
lowestDelta = null;
|
||||
}
|
||||
|
||||
function shouldAdjustOldDeltas(orgEvent, absDelta) {
|
||||
// If this is an older event and the delta is divisable by 120,
|
||||
// then we are assuming that the browser is treating this as an
|
||||
// older mouse wheel event and that we should divide the deltas
|
||||
// by 40 to try and get a more usable deltaFactor.
|
||||
// Side note, this actually impacts the reported scroll distance
|
||||
// in older browsers and can cause scrolling to be slower than native.
|
||||
// Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
|
||||
return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
|
||||
}
|
||||
|
||||
}));
|
||||
@ -1,8 +0,0 @@
|
||||
/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh)
|
||||
* Licensed under the MIT License (LICENSE.txt).
|
||||
*
|
||||
* Version: 3.1.11
|
||||
*
|
||||
* Requires: jQuery 1.2.2+
|
||||
*/
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.11",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b)["offsetParent"in a.fn?"offsetParent":"parent"]();return c.length||(c=a("body")),parseInt(c.css("fontSize"),10)},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})});
|
||||
@ -1,27 +0,0 @@
|
||||
{
|
||||
"name": "mousewheel",
|
||||
"title": "jQuery Mousewheel",
|
||||
"description": "A jQuery plugin that adds cross-browser mouse wheel support.",
|
||||
"keywords": [
|
||||
"mousewheel",
|
||||
"mouse",
|
||||
"event"
|
||||
],
|
||||
"version": "3.1.11",
|
||||
"author": {
|
||||
"name": "Brandon Aaron",
|
||||
"url": "http://brandon.aaron.sh"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://raw.github.com/brandonaaron/jquery-mousewheel/master/LICENSE.txt"
|
||||
}
|
||||
],
|
||||
"bugs": "https://github.com/brandonaaron/jquery-mousewheel/issues",
|
||||
"homepage": "https://github.com/brandonaaron/jquery-mousewheel",
|
||||
"download": "https://github.com/brandonaaron/jquery-mousewheel/tags",
|
||||
"dependencies": {
|
||||
"jquery": ">=1.2.2"
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
# browserify test
|
||||
|
||||
First run
|
||||
|
||||
```js
|
||||
npm install jquery-browserify
|
||||
```
|
||||
|
||||
Then run
|
||||
|
||||
```js
|
||||
browserify main.js > bundle.js
|
||||
```
|
||||
|
||||
Then open index.html and console and scroll with the mousewheel. Should see the events being logged.
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,4 +0,0 @@
|
||||
<script src="bundle.js"></script>
|
||||
<script>
|
||||
$(document).bind('mousewheel', function(e) { console.log(e); });
|
||||
</script>
|
||||
@ -1,2 +0,0 @@
|
||||
var $ = require('jquery-browserify');
|
||||
require('../../jquery.mousewheel.js')($);
|
||||
@ -1,239 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="iso-8859-1">
|
||||
<title>Testing mousewheel plugin</title>
|
||||
|
||||
<style>
|
||||
html {
|
||||
font: 13px Arial, sans-serif;
|
||||
}
|
||||
|
||||
#stage {
|
||||
color: #fff;
|
||||
position: relative;
|
||||
zoom: 1;
|
||||
}
|
||||
|
||||
#test1, #test2, #test3, #test4, #test5, #test6, #test7 {
|
||||
float: left;
|
||||
}
|
||||
|
||||
#test1 {
|
||||
background-color: #000;
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#test2 {
|
||||
background-color: #333;
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#test3 {
|
||||
background-color: #666;
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#test4 {
|
||||
background-color: #000;
|
||||
width: 120px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#test5 {
|
||||
background-color: #333;
|
||||
padding: 5px;
|
||||
width: 400px;
|
||||
height: 400px;
|
||||
}
|
||||
|
||||
#test6 {
|
||||
background-color: #666;
|
||||
padding: 5px;
|
||||
width: 250px;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
#test7 {
|
||||
background-color: #000;
|
||||
padding: 5px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
}
|
||||
|
||||
#forceScroll {
|
||||
clear: both;
|
||||
height: 1000px;
|
||||
}
|
||||
|
||||
#logger {
|
||||
position: absolute;
|
||||
top: 100px;
|
||||
left: 0;
|
||||
width: 480px;
|
||||
height: 310px;
|
||||
overflow: auto;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
#logger p {
|
||||
color: #000;
|
||||
padding: 2px;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#logger p:nth-child(even) {
|
||||
background-color: #ffffe8;
|
||||
}
|
||||
|
||||
#logger p:nth-child(10n) {
|
||||
border-bottom-color: #000;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
(function() {
|
||||
var verMatch = /v=([\w\.]+)/.exec(location.search),
|
||||
version = verMatch && verMatch[1],
|
||||
src;
|
||||
if (version)
|
||||
src = 'code.jquery.com/jquery-' + version;
|
||||
else
|
||||
src = 'code.jquery.com/jquery-git';
|
||||
document.write('<script src="http://' + src + '.js"><\/script>');
|
||||
})();
|
||||
</script>
|
||||
<script>
|
||||
$(function() {
|
||||
$('#userAgent').html(navigator.userAgent);
|
||||
$('#jqueryVersion').html($.fn.jquery);
|
||||
|
||||
var loghandle = function(event, delta) {
|
||||
var o = '', id = event.currentTarget.id || event.currentTarget.nodeName;
|
||||
|
||||
o = '#' + id + ':';
|
||||
|
||||
if (delta > 0)
|
||||
o += ' up (' + delta + ')';
|
||||
else if (delta < 0)
|
||||
o += ' down (' + delta + ')';
|
||||
|
||||
if (event.deltaY > 0)
|
||||
o += ' north (' + event.deltaY + ')';
|
||||
else if (event.deltaY < 0)
|
||||
o += ' south (' + event.deltaY + ')';
|
||||
|
||||
if (event.deltaX > 0)
|
||||
o += ' east (' + event.deltaX + ')';
|
||||
else if (event.deltaX < 0)
|
||||
o += ' west (' + event.deltaX + ')';
|
||||
|
||||
o += ' deltaFactor (' + event.deltaFactor + ')';
|
||||
|
||||
log( o );
|
||||
};
|
||||
|
||||
$(document)
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
});
|
||||
|
||||
$('#test1')
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
log('pageX: ' + event.pageX + ' pageY: ' + event.pageY );
|
||||
});
|
||||
|
||||
$('#test2')
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
return false; // prevent default
|
||||
});
|
||||
|
||||
$('#test3')
|
||||
.hover(function() { log('#test3: mouseover'); }, function() { log('#test3: mouseout'); })
|
||||
.mousewheel(function() {
|
||||
log('#test3: I should not have been logged');
|
||||
})
|
||||
.unmousewheel();
|
||||
|
||||
var testRemoval = function() {
|
||||
log('#test4: I should not have been logged');
|
||||
};
|
||||
|
||||
$('#test4')
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
return false;
|
||||
})
|
||||
.mousewheel(testRemoval)
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
return false;
|
||||
})
|
||||
.unmousewheel(testRemoval);
|
||||
|
||||
$('#test5')
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$('#test6')
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
$('#test7')
|
||||
.mousewheel(function(event, delta) {
|
||||
loghandle(event, delta);
|
||||
event.preventDefault();
|
||||
});
|
||||
|
||||
function log(msg) {
|
||||
$('#logger').append('<p>' + msg + '<\/p>')[0].scrollTop = 999999;
|
||||
}
|
||||
});
|
||||
</script>
|
||||
<script src="../jquery.mousewheel.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<h1 id="banner">jQuery mousewheel.js Test with jQuery <span id="jqueryVersion"></span></h1>
|
||||
<h2 id="userAgent"></h2>
|
||||
|
||||
<ul>
|
||||
<li><strong>Test1</strong> is just using the plain on <code>mousewheel()</code> with a function passed in and does not prevent default. (Also logs the value of <code>pageX</code> and <code>pageY</code> event properties.)</li>
|
||||
<li><strong>Test2</strong> should prevent the default action.</li>
|
||||
<li><strong>Test3</strong> should only log a <code>mouseover</code> and <code>mouseout</code> event. Testing <code>unmousewheel()</code>.</li>
|
||||
<li><strong>Test4</strong> has two handlers.</li>
|
||||
<li><strong>Test5</strong> is like Test2 but has children. The children should not scroll until mousing over them.</li>
|
||||
<li><strong>Test6</strong> is like Test5 but should not scroll children or parents.</li>
|
||||
<li><strong>Test7</strong> is like Test6 but has no children. It will propagate the event and scroll test 6 as well.</li>
|
||||
</ul>
|
||||
|
||||
|
||||
<div id="stage">
|
||||
<div id="test1"><p>Test1</p></div>
|
||||
<div id="test2"><p>Test2</p></div>
|
||||
<div id="test3"><p>Test3</p></div>
|
||||
<div id="test4"><p>Test4</p></div>
|
||||
<div id="test5">
|
||||
<p>Test5</p>
|
||||
<div id="test6">
|
||||
<p>Test6</p>
|
||||
<div id="test7"><p>Test7</p></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="logger"></div>
|
||||
</div>
|
||||
|
||||
<div id="forceScroll"></div>
|
||||
</body>
|
||||
</html>
|
||||
@ -1,48 +0,0 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Scroll Test</title>
|
||||
<style>
|
||||
html, body { margin: 0; padding: 0; width: 100%; height: 100%; }
|
||||
#emulated, #native {
|
||||
width: 40%;
|
||||
height: 100%;
|
||||
}
|
||||
#emulated { float: left; overflow: hidden; }
|
||||
#native { float: right; overflow: auto; }
|
||||
</style>
|
||||
<script>
|
||||
(function() {
|
||||
var verMatch = /v=([\w\.]+)/.exec(location.search),
|
||||
version = verMatch && verMatch[1],
|
||||
src;
|
||||
if (version)
|
||||
src = 'code.jquery.com/jquery-' + version;
|
||||
else
|
||||
src = 'code.jquery.com/jquery-git';
|
||||
document.write('<script src="http://' + src + '.js"><\/script>');
|
||||
})();
|
||||
</script>
|
||||
<script src="../jquery.mousewheel.js"></script>
|
||||
<script>
|
||||
var lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Phasellus rhoncus nibh ac ultricies blandit. Nunc blandit blandit lobortis. Maecenas id dolor scelerisque, facilisis dolor eu, interdum urna. Nullam consectetur lectus quis mi interdum accumsan. Nulla malesuada est nec neque suscipit pulvinar. Vivamus sagittis, nunc a porttitor tempus, mi neque eleifend diam, nec porttitor metus dui a orci. Cras tempus lobortis nisl ut sagittis. Maecenas semper in magna mollis venenatis. Vestibulum fermentum tincidunt fringilla.';
|
||||
$(function() {
|
||||
for (var i=0; i<30; i++) {
|
||||
var html = '<p>' + i + ' ' + lorem + '</p>';
|
||||
$('#emulated').append(html);
|
||||
$('#native').append(html);
|
||||
}
|
||||
$('#emulated').bind('mousewheel', function(event) {
|
||||
event.preventDefault();
|
||||
var scrollTop = this.scrollTop;
|
||||
this.scrollTop = (scrollTop + ((event.deltaY * event.deltaFactor) * -1));
|
||||
//console.log(event.deltaY, event.deltaFactor, event.originalEvent.deltaMode, event.originalEvent.wheelDelta);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="emulated"></div>
|
||||
<div id="native"></div>
|
||||
</body>
|
||||
</html>
|
||||
1
awx/ui/static/lib/lrInfiniteScroll
Submodule
1
awx/ui/static/lib/lrInfiniteScroll
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit c833e9d8ff56d6c66e2a21ed7f27ad840f159a8b
|
||||
@ -1,49 +0,0 @@
|
||||
{
|
||||
"name": "malihu-custom-scrollbar-plugin",
|
||||
"version": "2.8.4",
|
||||
"title": "malihu custom scrollbar plugin",
|
||||
"description": "Custom scrollbar jQuery plugin that's fully customizable with CSS. Features vertical/horizontal scrolling, mouse-wheel support, scroll easing, adjustable scrollbar height/width, nested scrollbars, user defined callbacks etc.",
|
||||
"main": "./jquery.mCustomScrollbar.js",
|
||||
"keywords": [
|
||||
"jquery",
|
||||
"custom scrollbar",
|
||||
"scrollbar"
|
||||
],
|
||||
"homepage": "http://manos.malihu.gr/jquery-custom-content-scroller/",
|
||||
"author": {
|
||||
"name": "malihu",
|
||||
"url": "http://manos.malihu.gr"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/malihu/malihu-custom-scrollbar-plugin.git"
|
||||
},
|
||||
"licenses": [
|
||||
{
|
||||
"type": "GNU LGPL",
|
||||
"url": "http://www.gnu.org/licenses/lgpl.html"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"jquery": ">=1.6",
|
||||
"jquery-mousewheel": ">=3.0.6"
|
||||
},
|
||||
"ignore": [
|
||||
"*.md",
|
||||
"*.txt",
|
||||
"*.json",
|
||||
"*.html",
|
||||
"/demo_files",
|
||||
"/source_files",
|
||||
"/js"
|
||||
],
|
||||
"_release": "2.8.4",
|
||||
"_resolution": {
|
||||
"type": "version",
|
||||
"tag": "2.8.4",
|
||||
"commit": "7f5be74468063f39e5f9bf0a8e2db380486c6e0e"
|
||||
},
|
||||
"_source": "git://github.com/malihu/malihu-custom-scrollbar-plugin.git",
|
||||
"_target": "2.8.4",
|
||||
"_originalSource": "malihu-custom-scrollbar-plugin"
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@ -1,474 +0,0 @@
|
||||
/* basic scrollbar styling */
|
||||
/* vertical scrollbar */
|
||||
.mCSB_container{
|
||||
width:auto;
|
||||
margin-right:30px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:0;
|
||||
}
|
||||
.mCS_disabled>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar,
|
||||
.mCS_destroyed>.mCustomScrollBox>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:30px;
|
||||
}
|
||||
.mCustomScrollBox>.mCSB_scrollTools{
|
||||
width:16px;
|
||||
height:100%;
|
||||
top:0;
|
||||
right:0;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerContainer{
|
||||
position:absolute;
|
||||
top:0;
|
||||
left:0;
|
||||
bottom:0;
|
||||
right:0;
|
||||
height:auto;
|
||||
}
|
||||
.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||
margin:20px 0;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:2px;
|
||||
height:100%;
|
||||
margin:0 auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger{
|
||||
cursor:pointer;
|
||||
width:100%;
|
||||
height:30px;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
height:100%;
|
||||
margin:0 auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
text-align:center;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp,
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
display:block;
|
||||
position:relative;
|
||||
height:20px;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
cursor:pointer;
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
top:100%;
|
||||
margin-top:-40px;
|
||||
}
|
||||
/* horizontal scrollbar */
|
||||
.mCSB_horizontal>.mCSB_container{
|
||||
height:auto;
|
||||
margin-right:0;
|
||||
margin-bottom:30px;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-bottom:0;
|
||||
}
|
||||
.mCS_disabled>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar,
|
||||
.mCS_destroyed>.mCSB_horizontal>.mCSB_container.mCS_no_scrollbar{
|
||||
margin-right:0;
|
||||
margin-bottom:30px;
|
||||
}
|
||||
.mCSB_horizontal.mCustomScrollBox>.mCSB_scrollTools{
|
||||
width:100%;
|
||||
height:16px;
|
||||
top:auto;
|
||||
right:auto;
|
||||
bottom:0;
|
||||
left:0;
|
||||
overflow:hidden;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools a+.mCSB_draggerContainer{
|
||||
margin:0 20px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px 0;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger{
|
||||
width:30px;
|
||||
height:100%;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
-webkit-border-radius:10px;
|
||||
-moz-border-radius:10px;
|
||||
border-radius:10px;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonLeft,
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
display:block;
|
||||
position:relative;
|
||||
width:20px;
|
||||
height:100%;
|
||||
overflow:hidden;
|
||||
margin:0 auto;
|
||||
cursor:pointer;
|
||||
float:left;
|
||||
}
|
||||
.mCSB_horizontal>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
margin-left:-40px;
|
||||
float:right;
|
||||
}
|
||||
.mCustomScrollBox{
|
||||
-ms-touch-action:none; /*MSPointer events - direct all pointer events to js*/
|
||||
}
|
||||
|
||||
/* default scrollbar colors and backgrounds (default theme) */
|
||||
.mCustomScrollBox>.mCSB_scrollTools{
|
||||
opacity:0.75;
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCustomScrollBox:hover>.mCSB_scrollTools{
|
||||
opacity:1;
|
||||
filter:"alpha(opacity=100)"; -ms-filter:"alpha(opacity=100)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.4);
|
||||
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
filter:"alpha(opacity=85)"; -ms-filter:"alpha(opacity=85)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp,
|
||||
.mCSB_scrollTools .mCSB_buttonDown,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft,
|
||||
.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-image:url(mCSB_buttons.png);
|
||||
background-repeat:no-repeat;
|
||||
opacity:0.4;
|
||||
filter:"alpha(opacity=40)"; -ms-filter:"alpha(opacity=40)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:0 0;
|
||||
/*
|
||||
sprites locations are 0 0/-16px 0/-32px 0/-48px 0 (light) and -80px 0/-96px 0/-112px 0/-128px 0 (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:0 -20px;
|
||||
/*
|
||||
sprites locations are 0 -20px/-16px -20px/-32px -20px/-48px -20px (light) and -80px -20px/-96px -20px/-112px -20px/-128px -20px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:0 -40px;
|
||||
/*
|
||||
sprites locations are 0 -40px/-20px -40px/-40px -40px/-60px -40px (light) and -80px -40px/-100px -40px/-120px -40px/-140px -40px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:0 -56px;
|
||||
/*
|
||||
sprites locations are 0 -56px/-20px -56px/-40px -56px/-60px -56px (light) and -80px -56px/-100px -56px/-120px -56px/-140px -56px (dark)
|
||||
*/
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonDown:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft:hover,
|
||||
.mCSB_scrollTools .mCSB_buttonRight:hover{
|
||||
opacity:0.75;
|
||||
filter:"alpha(opacity=75)"; -ms-filter:"alpha(opacity=75)"; /* old ie */
|
||||
}
|
||||
.mCSB_scrollTools .mCSB_buttonUp:active,
|
||||
.mCSB_scrollTools .mCSB_buttonDown:active,
|
||||
.mCSB_scrollTools .mCSB_buttonLeft:active,
|
||||
.mCSB_scrollTools .mCSB_buttonRight:active{
|
||||
opacity:0.9;
|
||||
filter:"alpha(opacity=90)"; -ms-filter:"alpha(opacity=90)"; /* old ie */
|
||||
}
|
||||
|
||||
/*scrollbar themes*/
|
||||
/*dark (dark colored scrollbar)*/
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.15);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-80px 0;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-80px -20px;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-80px -40px;
|
||||
}
|
||||
.mCS-dark>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-80px -56px;
|
||||
}
|
||||
/*light-2*/
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-light-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-32px 0;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-32px -20px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-40px -40px;
|
||||
}
|
||||
.mCS-light-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-40px -56px;
|
||||
}
|
||||
/*dark-2*/
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.1);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
-webkit-border-radius:1px;
|
||||
-moz-border-radius:1px;
|
||||
border-radius:1px;
|
||||
}
|
||||
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-dark-2.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px auto;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-112px 0;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-112px -20px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-120px -40px;
|
||||
}
|
||||
.mCS-dark-2>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-120px -56px;
|
||||
}
|
||||
/*light-thick*/
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:6px;
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.75);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-light-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:6px;
|
||||
margin:5px auto;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.85);
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(255,255,255,0.9);
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-16px 0;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-16px -20px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-20px -40px;
|
||||
}
|
||||
.mCS-light-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-20px -56px;
|
||||
}
|
||||
/*dark-thick*/
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:4px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.1);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:6px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
-webkit-border-radius:2px;
|
||||
-moz-border-radius:2px;
|
||||
border-radius:2px;
|
||||
}
|
||||
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
height:4px;
|
||||
margin:6px 0;
|
||||
}
|
||||
.mCS-dark-thick.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:6px;
|
||||
margin:5px auto;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-96px 0;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-96px -20px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-100px -40px;
|
||||
}
|
||||
.mCS-dark-thick>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-100px -56px;
|
||||
}
|
||||
/*light-thin*/
|
||||
.mCS-light-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#fff; /* rgba fallback */
|
||||
background:rgba(255,255,255,0.1);
|
||||
}
|
||||
.mCS-light-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:2px;
|
||||
}
|
||||
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
}
|
||||
.mCS-light-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px auto;
|
||||
}
|
||||
/*dark-thin*/
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.15);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:2px;
|
||||
background:#000; /* rgba fallback */
|
||||
background:rgba(0,0,0,0.75);
|
||||
}
|
||||
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_draggerRail{
|
||||
width:100%;
|
||||
}
|
||||
.mCS-dark-thin.mCSB_horizontal>.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{
|
||||
width:100%;
|
||||
height:2px;
|
||||
margin:7px auto;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.85);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{
|
||||
background:rgba(0,0,0,0.9);
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonUp{
|
||||
background-position:-80px 0;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonDown{
|
||||
background-position:-80px -20px;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonLeft{
|
||||
background-position:-80px -40px;
|
||||
}
|
||||
.mCS-dark-thin>.mCSB_scrollTools .mCSB_buttonRight{
|
||||
background-position:-80px -56px;
|
||||
}
|
||||
@ -1,989 +0,0 @@
|
||||
/*
|
||||
== malihu jquery custom scrollbars plugin ==
|
||||
version: 2.8.4
|
||||
author: malihu (http://manos.malihu.gr)
|
||||
plugin home: http://manos.malihu.gr/jquery-custom-content-scroller
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright 2010-2013 Manos Malihutsakis
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Lesser General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Lesser General Public License
|
||||
along with this program. If not, see http://www.gnu.org/licenses/lgpl.html.
|
||||
*/
|
||||
(function($){
|
||||
/*plugin script*/
|
||||
var methods={
|
||||
init:function(options){
|
||||
var defaults={
|
||||
set_width:false, /*optional element width: boolean, pixels, percentage*/
|
||||
set_height:false, /*optional element height: boolean, pixels, percentage*/
|
||||
horizontalScroll:false, /*scroll horizontally: boolean*/
|
||||
scrollInertia:950, /*scrolling inertia: integer (milliseconds)*/
|
||||
mouseWheel:true, /*mousewheel support: boolean*/
|
||||
mouseWheelPixels:"auto", /*mousewheel pixels amount: integer, "auto"*/
|
||||
autoDraggerLength:true, /*auto-adjust scrollbar dragger length: boolean*/
|
||||
autoHideScrollbar:false, /*auto-hide scrollbar when idle*/
|
||||
alwaysShowScrollbar:false, /*always show scrollbar even when there's nothing to scroll (disables autoHideScrollbar): boolean*/
|
||||
snapAmount:null, /* optional element always snaps to a multiple of this number in pixels */
|
||||
snapOffset:0, /* when snapping, snap with this number in pixels as an offset */
|
||||
scrollButtons:{ /*scroll buttons*/
|
||||
enable:false, /*scroll buttons support: boolean*/
|
||||
scrollType:"continuous", /*scroll buttons scrolling type: "continuous", "pixels"*/
|
||||
scrollSpeed:"auto", /*scroll buttons continuous scrolling speed: integer, "auto"*/
|
||||
scrollAmount:40 /*scroll buttons pixels scroll amount: integer (pixels)*/
|
||||
},
|
||||
advanced:{
|
||||
updateOnBrowserResize:true, /*update scrollbars on browser resize (for layouts based on percentages): boolean*/
|
||||
updateOnContentResize:false, /*auto-update scrollbars on content resize (for dynamic content): boolean*/
|
||||
autoExpandHorizontalScroll:false, /*auto-expand width for horizontal scrolling: boolean*/
|
||||
autoScrollOnFocus:true, /*auto-scroll on focused elements: boolean*/
|
||||
normalizeMouseWheelDelta:false /*normalize mouse-wheel delta (-1/1)*/
|
||||
},
|
||||
contentTouchScroll:true, /*scrolling by touch-swipe content: boolean*/
|
||||
callbacks:{
|
||||
onScrollStart:function(){}, /*user custom callback function on scroll start event*/
|
||||
onScroll:function(){}, /*user custom callback function on scroll event*/
|
||||
onTotalScroll:function(){}, /*user custom callback function on scroll end reached event*/
|
||||
onTotalScrollBack:function(){}, /*user custom callback function on scroll begin reached event*/
|
||||
onTotalScrollOffset:0, /*scroll end reached offset: integer (pixels)*/
|
||||
onTotalScrollBackOffset:0, /*scroll begin reached offset: integer (pixels)*/
|
||||
whileScrolling:function(){} /*user custom callback function on scrolling event*/
|
||||
},
|
||||
theme:"light" /*"light", "dark", "light-2", "dark-2", "light-thick", "dark-thick", "light-thin", "dark-thin"*/
|
||||
},
|
||||
options=$.extend(true,defaults,options);
|
||||
return this.each(function(){
|
||||
var $this=$(this);
|
||||
/*set element width/height, create markup for custom scrollbars, add classes*/
|
||||
if(options.set_width){
|
||||
$this.css("width",options.set_width);
|
||||
}
|
||||
if(options.set_height){
|
||||
$this.css("height",options.set_height);
|
||||
}
|
||||
if(!$(document).data("mCustomScrollbar-index")){
|
||||
$(document).data("mCustomScrollbar-index","1");
|
||||
}else{
|
||||
var mCustomScrollbarIndex=parseInt($(document).data("mCustomScrollbar-index"));
|
||||
$(document).data("mCustomScrollbar-index",mCustomScrollbarIndex+1);
|
||||
}
|
||||
$this.wrapInner("<div class='mCustomScrollBox"+" mCS-"+options.theme+"' id='mCSB_"+$(document).data("mCustomScrollbar-index")+"' style='position:relative; height:100%; overflow:hidden; max-width:100%;' />").addClass("mCustomScrollbar _mCS_"+$(document).data("mCustomScrollbar-index"));
|
||||
var mCustomScrollBox=$this.children(".mCustomScrollBox");
|
||||
if(options.horizontalScroll){
|
||||
mCustomScrollBox.addClass("mCSB_horizontal").wrapInner("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />");
|
||||
var mCSB_h_wrapper=mCustomScrollBox.children(".mCSB_h_wrapper");
|
||||
mCSB_h_wrapper.wrapInner("<div class='mCSB_container' style='position:absolute; left:0;' />").children(".mCSB_container").css({"width":mCSB_h_wrapper.children().outerWidth(),"position":"relative"}).unwrap();
|
||||
}else{
|
||||
mCustomScrollBox.wrapInner("<div class='mCSB_container' style='position:relative; top:0;' />");
|
||||
}
|
||||
var mCSB_container=mCustomScrollBox.children(".mCSB_container");
|
||||
if($.support.touch){
|
||||
mCSB_container.addClass("mCS_touch");
|
||||
}
|
||||
mCSB_container.after("<div class='mCSB_scrollTools' style='position:absolute;'><div class='mCSB_draggerContainer'><div class='mCSB_dragger' style='position:absolute;' oncontextmenu='return false;'><div class='mCSB_dragger_bar' style='position:relative;'></div></div><div class='mCSB_draggerRail'></div></div></div>");
|
||||
var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
|
||||
mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
|
||||
mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");
|
||||
if(options.horizontalScroll){
|
||||
mCSB_dragger.data("minDraggerWidth",mCSB_dragger.width());
|
||||
}else{
|
||||
mCSB_dragger.data("minDraggerHeight",mCSB_dragger.height());
|
||||
}
|
||||
if(options.scrollButtons.enable){
|
||||
if(options.horizontalScroll){
|
||||
mCSB_scrollTools.prepend("<a class='mCSB_buttonLeft' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonRight' oncontextmenu='return false;'></a>");
|
||||
}else{
|
||||
mCSB_scrollTools.prepend("<a class='mCSB_buttonUp' oncontextmenu='return false;'></a>").append("<a class='mCSB_buttonDown' oncontextmenu='return false;'></a>");
|
||||
}
|
||||
}
|
||||
/*mCustomScrollBox scrollTop and scrollLeft is always 0 to prevent browser focus scrolling*/
|
||||
mCustomScrollBox.bind("scroll",function(){
|
||||
if(!$this.is(".mCS_disabled")){ /*native focus scrolling for disabled scrollbars*/
|
||||
mCustomScrollBox.scrollTop(0).scrollLeft(0);
|
||||
}
|
||||
});
|
||||
/*store options, global vars/states, intervals*/
|
||||
$this.data({
|
||||
/*init state*/
|
||||
"mCS_Init":true,
|
||||
/*instance index*/
|
||||
"mCustomScrollbarIndex":$(document).data("mCustomScrollbar-index"),
|
||||
/*option parameters*/
|
||||
"horizontalScroll":options.horizontalScroll,
|
||||
"scrollInertia":options.scrollInertia,
|
||||
"scrollEasing":"mcsEaseOut",
|
||||
"mouseWheel":options.mouseWheel,
|
||||
"mouseWheelPixels":options.mouseWheelPixels,
|
||||
"autoDraggerLength":options.autoDraggerLength,
|
||||
"autoHideScrollbar":options.autoHideScrollbar,
|
||||
"alwaysShowScrollbar":options.alwaysShowScrollbar,
|
||||
"snapAmount":options.snapAmount,
|
||||
"snapOffset":options.snapOffset,
|
||||
"scrollButtons_enable":options.scrollButtons.enable,
|
||||
"scrollButtons_scrollType":options.scrollButtons.scrollType,
|
||||
"scrollButtons_scrollSpeed":options.scrollButtons.scrollSpeed,
|
||||
"scrollButtons_scrollAmount":options.scrollButtons.scrollAmount,
|
||||
"autoExpandHorizontalScroll":options.advanced.autoExpandHorizontalScroll,
|
||||
"autoScrollOnFocus":options.advanced.autoScrollOnFocus,
|
||||
"normalizeMouseWheelDelta":options.advanced.normalizeMouseWheelDelta,
|
||||
"contentTouchScroll":options.contentTouchScroll,
|
||||
"onScrollStart_Callback":options.callbacks.onScrollStart,
|
||||
"onScroll_Callback":options.callbacks.onScroll,
|
||||
"onTotalScroll_Callback":options.callbacks.onTotalScroll,
|
||||
"onTotalScrollBack_Callback":options.callbacks.onTotalScrollBack,
|
||||
"onTotalScroll_Offset":options.callbacks.onTotalScrollOffset,
|
||||
"onTotalScrollBack_Offset":options.callbacks.onTotalScrollBackOffset,
|
||||
"whileScrolling_Callback":options.callbacks.whileScrolling,
|
||||
/*events binding state*/
|
||||
"bindEvent_scrollbar_drag":false,
|
||||
"bindEvent_content_touch":false,
|
||||
"bindEvent_scrollbar_click":false,
|
||||
"bindEvent_mousewheel":false,
|
||||
"bindEvent_buttonsContinuous_y":false,
|
||||
"bindEvent_buttonsContinuous_x":false,
|
||||
"bindEvent_buttonsPixels_y":false,
|
||||
"bindEvent_buttonsPixels_x":false,
|
||||
"bindEvent_focusin":false,
|
||||
"bindEvent_autoHideScrollbar":false,
|
||||
/*buttons intervals*/
|
||||
"mCSB_buttonScrollRight":false,
|
||||
"mCSB_buttonScrollLeft":false,
|
||||
"mCSB_buttonScrollDown":false,
|
||||
"mCSB_buttonScrollUp":false
|
||||
});
|
||||
/*max-width/max-height*/
|
||||
if(options.horizontalScroll){
|
||||
if($this.css("max-width")!=="none"){
|
||||
if(!options.advanced.updateOnContentResize){ /*needs updateOnContentResize*/
|
||||
options.advanced.updateOnContentResize=true;
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if($this.css("max-height")!=="none"){
|
||||
var percentage=false,maxHeight=parseInt($this.css("max-height"));
|
||||
if($this.css("max-height").indexOf("%")>=0){
|
||||
percentage=maxHeight,
|
||||
maxHeight=$this.parent().height()*percentage/100;
|
||||
}
|
||||
var paddingY=($this.innerHeight()-$this.height());
|
||||
$this.css("overflow","hidden");
|
||||
mCustomScrollBox.css("max-height",maxHeight-paddingY);
|
||||
}
|
||||
}
|
||||
$this.mCustomScrollbar("update");
|
||||
/*window resize fn (for layouts based on percentages)*/
|
||||
if(options.advanced.updateOnBrowserResize){
|
||||
var mCSB_resizeTimeout,currWinWidth=$(window).width(),currWinHeight=$(window).height();
|
||||
$(window).bind("resize."+$this.data("mCustomScrollbarIndex"),function(){
|
||||
if(mCSB_resizeTimeout){
|
||||
clearTimeout(mCSB_resizeTimeout);
|
||||
}
|
||||
mCSB_resizeTimeout=setTimeout(function(){
|
||||
if(!$this.is(".mCS_disabled") && !$this.is(".mCS_destroyed")){
|
||||
var winWidth=$(window).width(),winHeight=$(window).height();
|
||||
if(currWinWidth!==winWidth || currWinHeight!==winHeight){ /*ie8 fix*/
|
||||
if($this.css("max-height")!=="none"){
|
||||
if(percentage){
|
||||
mCustomScrollBox.css("max-height",($this.parent().height()*percentage/100)-paddingY);
|
||||
}else{
|
||||
mCustomScrollBox.css("max-height",(parseInt($this.css("max-height"))-paddingY));
|
||||
}
|
||||
}
|
||||
$this.mCustomScrollbar("update");
|
||||
currWinWidth=winWidth; currWinHeight=winHeight;
|
||||
}
|
||||
}
|
||||
},150);
|
||||
});
|
||||
}
|
||||
/*content resize fn (for dynamically generated content)*/
|
||||
if(options.advanced.updateOnContentResize){
|
||||
var mCSB_onContentResize;
|
||||
if(options.horizontalScroll){
|
||||
var mCSB_containerOldSize=mCSB_container.outerWidth(),mCSB_contentOldSize=mCSB_container.innerWidth();
|
||||
}else{
|
||||
var mCSB_containerOldSize=mCSB_container.outerHeight(),mCSB_contentOldSize=mCSB_container.innerHeight();
|
||||
}
|
||||
mCSB_onContentResize=setInterval(function(){
|
||||
if(options.horizontalScroll){
|
||||
if(options.advanced.autoExpandHorizontalScroll){
|
||||
mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();
|
||||
}
|
||||
var mCSB_containerNewSize=mCSB_container.outerWidth(),mCSB_contentNewSize=mCSB_container.innerWidth();
|
||||
}else{
|
||||
var mCSB_containerNewSize=mCSB_container.outerHeight(),mCSB_contentNewSize=mCSB_container.innerHeight();
|
||||
}
|
||||
if(mCSB_containerNewSize!=mCSB_containerOldSize || mCSB_contentNewSize!=mCSB_contentOldSize){
|
||||
$this.mCustomScrollbar("update");
|
||||
mCSB_containerOldSize=mCSB_containerNewSize;
|
||||
mCSB_contentOldSize=mCSB_contentNewSize;
|
||||
}
|
||||
},300);
|
||||
}
|
||||
});
|
||||
},
|
||||
update:function(){
|
||||
var $this=$(this),
|
||||
mCustomScrollBox=$this.children(".mCustomScrollBox"),
|
||||
mCSB_container=mCustomScrollBox.children(".mCSB_container");
|
||||
mCSB_container.removeClass("mCS_no_scrollbar");
|
||||
$this.removeClass("mCS_disabled mCS_destroyed");
|
||||
mCustomScrollBox.scrollTop(0).scrollLeft(0); /*reset scrollTop/scrollLeft to prevent browser focus scrolling*/
|
||||
var mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
|
||||
mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
|
||||
mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger");
|
||||
if($this.data("horizontalScroll")){
|
||||
var mCSB_buttonLeft=mCSB_scrollTools.children(".mCSB_buttonLeft"),
|
||||
mCSB_buttonRight=mCSB_scrollTools.children(".mCSB_buttonRight"),
|
||||
mCustomScrollBoxW=mCustomScrollBox.width();
|
||||
if($this.data("autoExpandHorizontalScroll")){
|
||||
mCSB_container.css({"position":"absolute","width":"auto"}).wrap("<div class='mCSB_h_wrapper' style='position:relative; left:0; width:999999px;' />").css({"width":mCSB_container.outerWidth(),"position":"relative"}).unwrap();
|
||||
}
|
||||
var mCSB_containerW=mCSB_container.outerWidth();
|
||||
}else{
|
||||
var mCSB_buttonUp=mCSB_scrollTools.children(".mCSB_buttonUp"),
|
||||
mCSB_buttonDown=mCSB_scrollTools.children(".mCSB_buttonDown"),
|
||||
mCustomScrollBoxH=mCustomScrollBox.height(),
|
||||
mCSB_containerH=mCSB_container.outerHeight();
|
||||
}
|
||||
if(mCSB_containerH>mCustomScrollBoxH && !$this.data("horizontalScroll")){ /*content needs vertical scrolling*/
|
||||
mCSB_scrollTools.css("display","block");
|
||||
var mCSB_draggerContainerH=mCSB_draggerContainer.height();
|
||||
/*auto adjust scrollbar dragger length analogous to content*/
|
||||
if($this.data("autoDraggerLength")){
|
||||
var draggerH=Math.round(mCustomScrollBoxH/mCSB_containerH*mCSB_draggerContainerH),
|
||||
minDraggerH=mCSB_dragger.data("minDraggerHeight");
|
||||
if(draggerH<=minDraggerH){ /*min dragger height*/
|
||||
mCSB_dragger.css({"height":minDraggerH});
|
||||
}else if(draggerH>=mCSB_draggerContainerH-10){ /*max dragger height*/
|
||||
var mCSB_draggerContainerMaxH=mCSB_draggerContainerH-10;
|
||||
mCSB_dragger.css({"height":mCSB_draggerContainerMaxH});
|
||||
}else{
|
||||
mCSB_dragger.css({"height":draggerH});
|
||||
}
|
||||
mCSB_dragger.children(".mCSB_dragger_bar").css({"line-height":mCSB_dragger.height()+"px"});
|
||||
}
|
||||
var mCSB_draggerH=mCSB_dragger.height(),
|
||||
/*calculate and store scroll amount, add scrolling*/
|
||||
scrollAmount=(mCSB_containerH-mCustomScrollBoxH)/(mCSB_draggerContainerH-mCSB_draggerH);
|
||||
$this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);
|
||||
/*scroll*/
|
||||
var mCSB_containerP=Math.abs(mCSB_container.position().top);
|
||||
$this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});
|
||||
}else if(mCSB_containerW>mCustomScrollBoxW && $this.data("horizontalScroll")){ /*content needs horizontal scrolling*/
|
||||
mCSB_scrollTools.css("display","block");
|
||||
var mCSB_draggerContainerW=mCSB_draggerContainer.width();
|
||||
/*auto adjust scrollbar dragger length analogous to content*/
|
||||
if($this.data("autoDraggerLength")){
|
||||
var draggerW=Math.round(mCustomScrollBoxW/mCSB_containerW*mCSB_draggerContainerW),
|
||||
minDraggerW=mCSB_dragger.data("minDraggerWidth");
|
||||
if(draggerW<=minDraggerW){ /*min dragger height*/
|
||||
mCSB_dragger.css({"width":minDraggerW});
|
||||
}else if(draggerW>=mCSB_draggerContainerW-10){ /*max dragger height*/
|
||||
var mCSB_draggerContainerMaxW=mCSB_draggerContainerW-10;
|
||||
mCSB_dragger.css({"width":mCSB_draggerContainerMaxW});
|
||||
}else{
|
||||
mCSB_dragger.css({"width":draggerW});
|
||||
}
|
||||
}
|
||||
var mCSB_draggerW=mCSB_dragger.width(),
|
||||
/*calculate and store scroll amount, add scrolling*/
|
||||
scrollAmount=(mCSB_containerW-mCustomScrollBoxW)/(mCSB_draggerContainerW-mCSB_draggerW);
|
||||
$this.data("scrollAmount",scrollAmount).mCustomScrollbar("scrolling",mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight);
|
||||
/*scroll*/
|
||||
var mCSB_containerP=Math.abs(mCSB_container.position().left);
|
||||
$this.mCustomScrollbar("scrollTo",mCSB_containerP,{scrollInertia:0,trigger:"internal"});
|
||||
}else{ /*content does not need scrolling*/
|
||||
/*unbind events, reset content position, hide scrollbars, remove classes*/
|
||||
mCustomScrollBox.unbind("mousewheel focusin");
|
||||
if($this.data("horizontalScroll")){
|
||||
mCSB_dragger.add(mCSB_container).css("left",0);
|
||||
}else{
|
||||
mCSB_dragger.add(mCSB_container).css("top",0);
|
||||
}
|
||||
if ($this.data("alwaysShowScrollbar")) {
|
||||
if(!$this.data("horizontalScroll")){ /*vertical scrolling*/
|
||||
mCSB_dragger.css({"height":mCSB_draggerContainer.height()});
|
||||
}else if($this.data("horizontalScroll")){ /*horizontal scrolling*/
|
||||
mCSB_dragger.css({"width":mCSB_draggerContainer.width()});
|
||||
}
|
||||
} else {
|
||||
mCSB_scrollTools.css("display","none");
|
||||
mCSB_container.addClass("mCS_no_scrollbar");
|
||||
}
|
||||
$this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false});
|
||||
}
|
||||
},
|
||||
scrolling:function(mCustomScrollBox,mCSB_container,mCSB_draggerContainer,mCSB_dragger,mCSB_buttonUp,mCSB_buttonDown,mCSB_buttonLeft,mCSB_buttonRight){
|
||||
var $this=$(this);
|
||||
/*scrollbar drag scrolling*/
|
||||
if(!$this.data("bindEvent_scrollbar_drag")){
|
||||
var mCSB_draggerDragY,mCSB_draggerDragX,
|
||||
mCSB_dragger_downEvent,mCSB_dragger_moveEvent,mCSB_dragger_upEvent;
|
||||
if($.support.pointer){ /*pointer*/
|
||||
mCSB_dragger_downEvent="pointerdown";
|
||||
mCSB_dragger_moveEvent="pointermove";
|
||||
mCSB_dragger_upEvent="pointerup";
|
||||
}else if($.support.msPointer){ /*MSPointer*/
|
||||
mCSB_dragger_downEvent="MSPointerDown";
|
||||
mCSB_dragger_moveEvent="MSPointerMove";
|
||||
mCSB_dragger_upEvent="MSPointerUp";
|
||||
}
|
||||
if($.support.pointer || $.support.msPointer){ /*pointer, MSPointer*/
|
||||
mCSB_dragger.bind(mCSB_dragger_downEvent,function(e){
|
||||
e.preventDefault();
|
||||
$this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");
|
||||
var elem=$(this),
|
||||
elemOffset=elem.offset(),
|
||||
x=e.originalEvent.pageX-elemOffset.left,
|
||||
y=e.originalEvent.pageY-elemOffset.top;
|
||||
if(x<elem.width() && x>0 && y<elem.height() && y>0){
|
||||
mCSB_draggerDragY=y;
|
||||
mCSB_draggerDragX=x;
|
||||
}
|
||||
});
|
||||
$(document).bind(mCSB_dragger_moveEvent+"."+$this.data("mCustomScrollbarIndex"),function(e){
|
||||
e.preventDefault();
|
||||
if($this.data("on_drag")){
|
||||
var elem=mCSB_dragger,
|
||||
elemOffset=elem.offset(),
|
||||
x=e.originalEvent.pageX-elemOffset.left,
|
||||
y=e.originalEvent.pageY-elemOffset.top;
|
||||
scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
|
||||
}
|
||||
}).bind(mCSB_dragger_upEvent+"."+$this.data("mCustomScrollbarIndex"),function(e){
|
||||
$this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");
|
||||
});
|
||||
}else{ /*mouse/touch*/
|
||||
mCSB_dragger.bind("mousedown touchstart",function(e){
|
||||
e.preventDefault(); e.stopImmediatePropagation();
|
||||
var elem=$(this),elemOffset=elem.offset(),x,y;
|
||||
if(e.type==="touchstart"){
|
||||
var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
|
||||
x=touch.pageX-elemOffset.left; y=touch.pageY-elemOffset.top;
|
||||
}else{
|
||||
$this.data({"on_drag":true}); mCSB_dragger.addClass("mCSB_dragger_onDrag");
|
||||
x=e.pageX-elemOffset.left; y=e.pageY-elemOffset.top;
|
||||
}
|
||||
if(x<elem.width() && x>0 && y<elem.height() && y>0){
|
||||
mCSB_draggerDragY=y; mCSB_draggerDragX=x;
|
||||
}
|
||||
}).bind("touchmove",function(e){
|
||||
e.preventDefault(); e.stopImmediatePropagation();
|
||||
var touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0],
|
||||
elem=$(this),
|
||||
elemOffset=elem.offset(),
|
||||
x=touch.pageX-elemOffset.left,
|
||||
y=touch.pageY-elemOffset.top;
|
||||
scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
|
||||
});
|
||||
$(document).bind("mousemove."+$this.data("mCustomScrollbarIndex"),function(e){
|
||||
if($this.data("on_drag")){
|
||||
var elem=mCSB_dragger,
|
||||
elemOffset=elem.offset(),
|
||||
x=e.pageX-elemOffset.left,
|
||||
y=e.pageY-elemOffset.top;
|
||||
scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x);
|
||||
}
|
||||
}).bind("mouseup."+$this.data("mCustomScrollbarIndex"),function(e){
|
||||
$this.data({"on_drag":false}); mCSB_dragger.removeClass("mCSB_dragger_onDrag");
|
||||
});
|
||||
}
|
||||
$this.data({"bindEvent_scrollbar_drag":true});
|
||||
}
|
||||
function scrollbarDrag(mCSB_draggerDragY,mCSB_draggerDragX,y,x){
|
||||
if($this.data("horizontalScroll")){
|
||||
$this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().left-(mCSB_draggerDragX))+x,{moveDragger:true,trigger:"internal"});
|
||||
}else{
|
||||
$this.mCustomScrollbar("scrollTo",(mCSB_dragger.position().top-(mCSB_draggerDragY))+y,{moveDragger:true,trigger:"internal"});
|
||||
}
|
||||
}
|
||||
/*content touch-drag*/
|
||||
if($.support.touch && $this.data("contentTouchScroll")){
|
||||
if(!$this.data("bindEvent_content_touch")){
|
||||
var touch,
|
||||
elem,elemOffset,y,x,mCSB_containerTouchY,mCSB_containerTouchX;
|
||||
mCSB_container.bind("touchstart",function(e){
|
||||
e.stopImmediatePropagation();
|
||||
touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
|
||||
elem=$(this);
|
||||
elemOffset=elem.offset();
|
||||
x=touch.pageX-elemOffset.left;
|
||||
y=touch.pageY-elemOffset.top;
|
||||
mCSB_containerTouchY=y;
|
||||
mCSB_containerTouchX=x;
|
||||
});
|
||||
mCSB_container.bind("touchmove",function(e){
|
||||
e.preventDefault(); e.stopImmediatePropagation();
|
||||
touch=e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
|
||||
elem=$(this).parent();
|
||||
elemOffset=elem.offset();
|
||||
x=touch.pageX-elemOffset.left;
|
||||
y=touch.pageY-elemOffset.top;
|
||||
if($this.data("horizontalScroll")){
|
||||
$this.mCustomScrollbar("scrollTo",mCSB_containerTouchX-x,{trigger:"internal"});
|
||||
}else{
|
||||
$this.mCustomScrollbar("scrollTo",mCSB_containerTouchY-y,{trigger:"internal"});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
/*dragger rail click scrolling*/
|
||||
if(!$this.data("bindEvent_scrollbar_click")){
|
||||
mCSB_draggerContainer.bind("click",function(e){
|
||||
var scrollToPos=(e.pageY-mCSB_draggerContainer.offset().top)*$this.data("scrollAmount"),target=$(e.target);
|
||||
if($this.data("horizontalScroll")){
|
||||
scrollToPos=(e.pageX-mCSB_draggerContainer.offset().left)*$this.data("scrollAmount");
|
||||
}
|
||||
if(target.hasClass("mCSB_draggerContainer") || target.hasClass("mCSB_draggerRail")){
|
||||
$this.mCustomScrollbar("scrollTo",scrollToPos,{trigger:"internal",scrollEasing:"draggerRailEase"});
|
||||
}
|
||||
});
|
||||
$this.data({"bindEvent_scrollbar_click":true});
|
||||
}
|
||||
/*mousewheel scrolling*/
|
||||
if($this.data("mouseWheel")){
|
||||
if(!$this.data("bindEvent_mousewheel")){
|
||||
mCustomScrollBox.bind("mousewheel",function(e,delta){
|
||||
var scrollTo,mouseWheelPixels=$this.data("mouseWheelPixels"),absPos=Math.abs(mCSB_container.position().top),
|
||||
draggerPos=mCSB_dragger.position().top,limit=mCSB_draggerContainer.height()-mCSB_dragger.height();
|
||||
if($this.data("normalizeMouseWheelDelta")){
|
||||
if(delta<0){delta=-1;}else{delta=1;}
|
||||
}
|
||||
if(mouseWheelPixels==="auto"){
|
||||
mouseWheelPixels=100+Math.round($this.data("scrollAmount")/2);
|
||||
}
|
||||
if($this.data("horizontalScroll")){
|
||||
draggerPos=mCSB_dragger.position().left;
|
||||
limit=mCSB_draggerContainer.width()-mCSB_dragger.width();
|
||||
absPos=Math.abs(mCSB_container.position().left);
|
||||
}
|
||||
if((delta>0 && draggerPos!==0) || (delta<0 && draggerPos!==limit)){e.preventDefault(); e.stopImmediatePropagation();}
|
||||
scrollTo=absPos-(delta*mouseWheelPixels);
|
||||
$this.mCustomScrollbar("scrollTo",scrollTo,{trigger:"internal"});
|
||||
});
|
||||
$this.data({"bindEvent_mousewheel":true});
|
||||
}
|
||||
}
|
||||
/*buttons scrolling*/
|
||||
if($this.data("scrollButtons_enable")){
|
||||
if($this.data("scrollButtons_scrollType")==="pixels"){ /*scroll by pixels*/
|
||||
if($this.data("horizontalScroll")){
|
||||
mCSB_buttonRight.add(mCSB_buttonLeft).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);
|
||||
$this.data({"bindEvent_buttonsContinuous_x":false});
|
||||
if(!$this.data("bindEvent_buttonsPixels_x")){
|
||||
/*scroll right*/
|
||||
mCSB_buttonRight.bind("click",function(e){
|
||||
e.preventDefault();
|
||||
PixelsScrollTo(Math.abs(mCSB_container.position().left)+$this.data("scrollButtons_scrollAmount"));
|
||||
});
|
||||
/*scroll left*/
|
||||
mCSB_buttonLeft.bind("click",function(e){
|
||||
e.preventDefault();
|
||||
PixelsScrollTo(Math.abs(mCSB_container.position().left)-$this.data("scrollButtons_scrollAmount"));
|
||||
});
|
||||
$this.data({"bindEvent_buttonsPixels_x":true});
|
||||
}
|
||||
}else{
|
||||
mCSB_buttonDown.add(mCSB_buttonUp).unbind("mousedown touchstart MSPointerDown pointerdown mouseup MSPointerUp pointerup mouseout MSPointerOut pointerout touchend",mCSB_buttonRight_stop,mCSB_buttonLeft_stop);
|
||||
$this.data({"bindEvent_buttonsContinuous_y":false});
|
||||
if(!$this.data("bindEvent_buttonsPixels_y")){
|
||||
/*scroll down*/
|
||||
mCSB_buttonDown.bind("click",function(e){
|
||||
e.preventDefault();
|
||||
PixelsScrollTo(Math.abs(mCSB_container.position().top)+$this.data("scrollButtons_scrollAmount"));
|
||||
});
|
||||
/*scroll up*/
|
||||
mCSB_buttonUp.bind("click",function(e){
|
||||
e.preventDefault();
|
||||
PixelsScrollTo(Math.abs(mCSB_container.position().top)-$this.data("scrollButtons_scrollAmount"));
|
||||
});
|
||||
$this.data({"bindEvent_buttonsPixels_y":true});
|
||||
}
|
||||
}
|
||||
function PixelsScrollTo(to){
|
||||
if(!mCSB_dragger.data("preventAction")){
|
||||
mCSB_dragger.data("preventAction",true);
|
||||
$this.mCustomScrollbar("scrollTo",to,{trigger:"internal"});
|
||||
}
|
||||
}
|
||||
}else{ /*continuous scrolling*/
|
||||
if($this.data("horizontalScroll")){
|
||||
mCSB_buttonRight.add(mCSB_buttonLeft).unbind("click");
|
||||
$this.data({"bindEvent_buttonsPixels_x":false});
|
||||
if(!$this.data("bindEvent_buttonsContinuous_x")){
|
||||
/*scroll right*/
|
||||
mCSB_buttonRight.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
|
||||
e.preventDefault();
|
||||
var scrollButtonsSpeed=ScrollButtonsSpeed();
|
||||
$this.data({"mCSB_buttonScrollRight":setInterval(function(){
|
||||
$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
|
||||
},17)});
|
||||
});
|
||||
var mCSB_buttonRight_stop=function(e){
|
||||
e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollRight"));
|
||||
}
|
||||
mCSB_buttonRight.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonRight_stop);
|
||||
/*scroll left*/
|
||||
mCSB_buttonLeft.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
|
||||
e.preventDefault();
|
||||
var scrollButtonsSpeed=ScrollButtonsSpeed();
|
||||
$this.data({"mCSB_buttonScrollLeft":setInterval(function(){
|
||||
$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().left)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
|
||||
},17)});
|
||||
});
|
||||
var mCSB_buttonLeft_stop=function(e){
|
||||
e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollLeft"));
|
||||
}
|
||||
mCSB_buttonLeft.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonLeft_stop);
|
||||
$this.data({"bindEvent_buttonsContinuous_x":true});
|
||||
}
|
||||
}else{
|
||||
mCSB_buttonDown.add(mCSB_buttonUp).unbind("click");
|
||||
$this.data({"bindEvent_buttonsPixels_y":false});
|
||||
if(!$this.data("bindEvent_buttonsContinuous_y")){
|
||||
/*scroll down*/
|
||||
mCSB_buttonDown.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
|
||||
e.preventDefault();
|
||||
var scrollButtonsSpeed=ScrollButtonsSpeed();
|
||||
$this.data({"mCSB_buttonScrollDown":setInterval(function(){
|
||||
$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)+scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
|
||||
},17)});
|
||||
});
|
||||
var mCSB_buttonDown_stop=function(e){
|
||||
e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollDown"));
|
||||
}
|
||||
mCSB_buttonDown.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonDown_stop);
|
||||
/*scroll up*/
|
||||
mCSB_buttonUp.bind("mousedown touchstart MSPointerDown pointerdown",function(e){
|
||||
e.preventDefault();
|
||||
var scrollButtonsSpeed=ScrollButtonsSpeed();
|
||||
$this.data({"mCSB_buttonScrollUp":setInterval(function(){
|
||||
$this.mCustomScrollbar("scrollTo",Math.abs(mCSB_container.position().top)-scrollButtonsSpeed,{trigger:"internal",scrollEasing:"easeOutCirc"});
|
||||
},17)});
|
||||
});
|
||||
var mCSB_buttonUp_stop=function(e){
|
||||
e.preventDefault(); clearInterval($this.data("mCSB_buttonScrollUp"));
|
||||
}
|
||||
mCSB_buttonUp.bind("mouseup touchend MSPointerUp pointerup mouseout MSPointerOut pointerout",mCSB_buttonUp_stop);
|
||||
$this.data({"bindEvent_buttonsContinuous_y":true});
|
||||
}
|
||||
}
|
||||
function ScrollButtonsSpeed(){
|
||||
var speed=$this.data("scrollButtons_scrollSpeed");
|
||||
if($this.data("scrollButtons_scrollSpeed")==="auto"){
|
||||
speed=Math.round(($this.data("scrollInertia")+100)/40);
|
||||
}
|
||||
return speed;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*scrolling on element focus (e.g. via TAB key)*/
|
||||
if($this.data("autoScrollOnFocus")){
|
||||
if(!$this.data("bindEvent_focusin")){
|
||||
mCustomScrollBox.bind("focusin",function(){
|
||||
mCustomScrollBox.scrollTop(0).scrollLeft(0);
|
||||
var focusedElem=$(document.activeElement);
|
||||
if(focusedElem.is("input,textarea,select,button,a[tabindex],area,object")){
|
||||
var mCSB_containerPos=mCSB_container.position().top,
|
||||
focusedElemPos=focusedElem.position().top,
|
||||
visibleLimit=mCustomScrollBox.height()-focusedElem.outerHeight();
|
||||
if($this.data("horizontalScroll")){
|
||||
mCSB_containerPos=mCSB_container.position().left;
|
||||
focusedElemPos=focusedElem.position().left;
|
||||
visibleLimit=mCustomScrollBox.width()-focusedElem.outerWidth();
|
||||
}
|
||||
if(mCSB_containerPos+focusedElemPos<0 || mCSB_containerPos+focusedElemPos>visibleLimit){
|
||||
$this.mCustomScrollbar("scrollTo",focusedElemPos,{trigger:"internal"});
|
||||
}
|
||||
}
|
||||
});
|
||||
$this.data({"bindEvent_focusin":true});
|
||||
}
|
||||
}
|
||||
/*auto-hide scrollbar*/
|
||||
if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){
|
||||
if(!$this.data("bindEvent_autoHideScrollbar")){
|
||||
mCustomScrollBox.bind("mouseenter",function(e){
|
||||
mCustomScrollBox.addClass("mCS-mouse-over");
|
||||
functions.showScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));
|
||||
}).bind("mouseleave touchend",function(e){
|
||||
mCustomScrollBox.removeClass("mCS-mouse-over");
|
||||
if(e.type==="mouseleave"){functions.hideScrollbar.call(mCustomScrollBox.children(".mCSB_scrollTools"));}
|
||||
});
|
||||
$this.data({"bindEvent_autoHideScrollbar":true});
|
||||
}
|
||||
}
|
||||
},
|
||||
scrollTo:function(scrollTo,options){
|
||||
var $this=$(this),
|
||||
defaults={
|
||||
moveDragger:false,
|
||||
trigger:"external",
|
||||
callbacks:true,
|
||||
scrollInertia:$this.data("scrollInertia"),
|
||||
scrollEasing:$this.data("scrollEasing")
|
||||
},
|
||||
options=$.extend(defaults,options),
|
||||
draggerScrollTo,
|
||||
mCustomScrollBox=$this.children(".mCustomScrollBox"),
|
||||
mCSB_container=mCustomScrollBox.children(".mCSB_container"),
|
||||
mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
|
||||
mCSB_draggerContainer=mCSB_scrollTools.children(".mCSB_draggerContainer"),
|
||||
mCSB_dragger=mCSB_draggerContainer.children(".mCSB_dragger"),
|
||||
contentSpeed=draggerSpeed=options.scrollInertia,
|
||||
scrollBeginning,scrollBeginningOffset,totalScroll,totalScrollOffset;
|
||||
if(!mCSB_container.hasClass("mCS_no_scrollbar")){
|
||||
$this.data({"mCS_trigger":options.trigger});
|
||||
if($this.data("mCS_Init")){options.callbacks=false;}
|
||||
if(scrollTo || scrollTo===0){
|
||||
if(typeof(scrollTo)==="number"){ /*if integer, scroll by number of pixels*/
|
||||
if(options.moveDragger){ /*scroll dragger*/
|
||||
draggerScrollTo=scrollTo;
|
||||
if($this.data("horizontalScroll")){
|
||||
scrollTo=mCSB_dragger.position().left*$this.data("scrollAmount");
|
||||
}else{
|
||||
scrollTo=mCSB_dragger.position().top*$this.data("scrollAmount");
|
||||
}
|
||||
draggerSpeed=0;
|
||||
}else{ /*scroll content by default*/
|
||||
draggerScrollTo=scrollTo/$this.data("scrollAmount");
|
||||
}
|
||||
}else if(typeof(scrollTo)==="string"){ /*if string, scroll by element position*/
|
||||
var target;
|
||||
if(scrollTo==="top"){ /*scroll to top*/
|
||||
target=0;
|
||||
}else if(scrollTo==="bottom" && !$this.data("horizontalScroll")){ /*scroll to bottom*/
|
||||
target=mCSB_container.outerHeight()-mCustomScrollBox.height();
|
||||
}else if(scrollTo==="left"){ /*scroll to left*/
|
||||
target=0;
|
||||
}else if(scrollTo==="right" && $this.data("horizontalScroll")){ /*scroll to right*/
|
||||
target=mCSB_container.outerWidth()-mCustomScrollBox.width();
|
||||
}else if(scrollTo==="first"){ /*scroll to first element position*/
|
||||
target=$this.find(".mCSB_container").find(":first");
|
||||
}else if(scrollTo==="last"){ /*scroll to last element position*/
|
||||
target=$this.find(".mCSB_container").find(":last");
|
||||
}else{ /*scroll to element position*/
|
||||
target=$this.find(scrollTo);
|
||||
}
|
||||
if(target.length===1){ /*if such unique element exists, scroll to it*/
|
||||
if($this.data("horizontalScroll")){
|
||||
scrollTo=target.position().left;
|
||||
}else{
|
||||
scrollTo=target.position().top;
|
||||
}
|
||||
draggerScrollTo=scrollTo/$this.data("scrollAmount");
|
||||
}else{
|
||||
draggerScrollTo=scrollTo=target;
|
||||
}
|
||||
}else if(typeof(scrollTo)==="object"){ /*if object, scroll by element position*/
|
||||
var target=$(scrollTo);
|
||||
if(target.length===1){ /*if such unique element exists, scroll to it*/
|
||||
if($this.data("horizontalScroll")){
|
||||
scrollTo=target.position().left;
|
||||
}else{
|
||||
scrollTo=target.position().top;
|
||||
}
|
||||
draggerScrollTo=scrollTo/$this.data("scrollAmount");
|
||||
}else{
|
||||
draggerScrollTo=scrollTo=target;
|
||||
}
|
||||
}
|
||||
/*scroll to*/
|
||||
if($this.data("horizontalScroll")){
|
||||
if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/
|
||||
scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");
|
||||
}
|
||||
if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/
|
||||
totalScrollOffset=mCustomScrollBox.width()-mCSB_container.outerWidth()+$this.data("onTotalScroll_Offset");
|
||||
}
|
||||
if(draggerScrollTo<0){ /*scroll start position*/
|
||||
draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollLeft"));
|
||||
if(!scrollBeginningOffset){scrollBeginning=true;}
|
||||
}else if(draggerScrollTo>=mCSB_draggerContainer.width()-mCSB_dragger.width()){ /*scroll end position*/
|
||||
draggerScrollTo=mCSB_draggerContainer.width()-mCSB_dragger.width();
|
||||
scrollTo=mCustomScrollBox.width()-mCSB_container.outerWidth(); clearInterval($this.data("mCSB_buttonScrollRight"));
|
||||
if(!totalScrollOffset){totalScroll=true;}
|
||||
}else{scrollTo=-scrollTo;}
|
||||
var snapAmount = $this.data("snapAmount");
|
||||
if (snapAmount) {
|
||||
scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");
|
||||
}
|
||||
/*scrolling animation*/
|
||||
functions.mTweenAxis.call(this,mCSB_dragger[0],"left",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);
|
||||
functions.mTweenAxis.call(this,mCSB_container[0],"left",Math.round(scrollTo),contentSpeed,options.scrollEasing,{
|
||||
onStart:function(){
|
||||
if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}
|
||||
if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}
|
||||
},
|
||||
onUpdate:function(){
|
||||
if(options.callbacks){callbacks("whileScrolling");}
|
||||
},
|
||||
onComplete:function(){
|
||||
if(options.callbacks){
|
||||
callbacks("onScroll");
|
||||
if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().left>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}
|
||||
if(totalScroll || (totalScrollOffset && mCSB_container.position().left<=totalScrollOffset)){callbacks("onTotalScroll");}
|
||||
}
|
||||
mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);
|
||||
if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
if($this.data("onTotalScrollBack_Offset")){ /*scroll beginning offset*/
|
||||
scrollBeginningOffset=-$this.data("onTotalScrollBack_Offset");
|
||||
}
|
||||
if($this.data("onTotalScroll_Offset")){ /*total scroll offset*/
|
||||
totalScrollOffset=mCustomScrollBox.height()-mCSB_container.outerHeight()+$this.data("onTotalScroll_Offset");
|
||||
}
|
||||
if(draggerScrollTo<0){ /*scroll start position*/
|
||||
draggerScrollTo=scrollTo=0; clearInterval($this.data("mCSB_buttonScrollUp"));
|
||||
if(!scrollBeginningOffset){scrollBeginning=true;}
|
||||
}else if(draggerScrollTo>=mCSB_draggerContainer.height()-mCSB_dragger.height()){ /*scroll end position*/
|
||||
draggerScrollTo=mCSB_draggerContainer.height()-mCSB_dragger.height();
|
||||
scrollTo=mCustomScrollBox.height()-mCSB_container.outerHeight(); clearInterval($this.data("mCSB_buttonScrollDown"));
|
||||
if(!totalScrollOffset){totalScroll=true;}
|
||||
}else{scrollTo=-scrollTo;}
|
||||
var snapAmount = $this.data("snapAmount");
|
||||
if (snapAmount) {
|
||||
scrollTo = Math.round(scrollTo / snapAmount) * snapAmount - $this.data("snapOffset");
|
||||
}
|
||||
/*scrolling animation*/
|
||||
functions.mTweenAxis.call(this,mCSB_dragger[0],"top",Math.round(draggerScrollTo),draggerSpeed,options.scrollEasing);
|
||||
functions.mTweenAxis.call(this,mCSB_container[0],"top",Math.round(scrollTo),contentSpeed,options.scrollEasing,{
|
||||
onStart:function(){
|
||||
if(options.callbacks && !$this.data("mCS_tweenRunning")){callbacks("onScrollStart");}
|
||||
if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){functions.showScrollbar.call(mCSB_scrollTools);}
|
||||
},
|
||||
onUpdate:function(){
|
||||
if(options.callbacks){callbacks("whileScrolling");}
|
||||
},
|
||||
onComplete:function(){
|
||||
if(options.callbacks){
|
||||
callbacks("onScroll");
|
||||
if(scrollBeginning || (scrollBeginningOffset && mCSB_container.position().top>=scrollBeginningOffset)){callbacks("onTotalScrollBack");}
|
||||
if(totalScroll || (totalScrollOffset && mCSB_container.position().top<=totalScrollOffset)){callbacks("onTotalScroll");}
|
||||
}
|
||||
mCSB_dragger.data("preventAction",false); $this.data("mCS_tweenRunning",false);
|
||||
if($this.data("autoHideScrollbar") && !$this.data("alwaysShowScrollbar")){if(!mCustomScrollBox.hasClass("mCS-mouse-over")){functions.hideScrollbar.call(mCSB_scrollTools);}}
|
||||
}
|
||||
});
|
||||
}
|
||||
if($this.data("mCS_Init")){$this.data({"mCS_Init":false});}
|
||||
}
|
||||
}
|
||||
/*callbacks*/
|
||||
function callbacks(cb){
|
||||
if($this.data("mCustomScrollbarIndex")){
|
||||
this.mcs = {
|
||||
top: mCSB_container.position().top, left: mCSB_container.position().left,
|
||||
draggerTop: mCSB_dragger.position().top, draggerLeft: mCSB_dragger.position().left,
|
||||
topPct: Math.round((100 * Math.abs(mCSB_container.position().top)) / Math.abs(mCSB_container.outerHeight() - mCustomScrollBox.height())),
|
||||
leftPct: Math.round((100 * Math.abs(mCSB_container.position().left)) / Math.abs(mCSB_container.outerWidth() - mCustomScrollBox.width()))
|
||||
};
|
||||
switch (cb) {
|
||||
/*start scrolling callback*/
|
||||
case "onScrollStart":
|
||||
$this.data("mCS_tweenRunning", true).data("onScrollStart_Callback").call($this, this.mcs);
|
||||
break;
|
||||
case "whileScrolling":
|
||||
$this.data("whileScrolling_Callback").call($this, this.mcs);
|
||||
break;
|
||||
case "onScroll":
|
||||
$this.data("onScroll_Callback").call($this, this.mcs);
|
||||
break;
|
||||
case "onTotalScrollBack":
|
||||
$this.data("onTotalScrollBack_Callback").call($this, this.mcs);
|
||||
break;
|
||||
case "onTotalScroll":
|
||||
$this.data("onTotalScroll_Callback").call($this, this.mcs);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
stop:function(){
|
||||
var $this=$(this),
|
||||
mCSB_container=$this.children().children(".mCSB_container"),
|
||||
mCSB_dragger=$this.children().children().children().children(".mCSB_dragger");
|
||||
functions.mTweenAxisStop.call(this,mCSB_container[0]);
|
||||
functions.mTweenAxisStop.call(this,mCSB_dragger[0]);
|
||||
},
|
||||
disable:function(resetScroll){
|
||||
var $this=$(this),
|
||||
mCustomScrollBox=$this.children(".mCustomScrollBox"),
|
||||
mCSB_container=mCustomScrollBox.children(".mCSB_container"),
|
||||
mCSB_scrollTools=mCustomScrollBox.children(".mCSB_scrollTools"),
|
||||
mCSB_dragger=mCSB_scrollTools.children().children(".mCSB_dragger");
|
||||
mCustomScrollBox.unbind("mousewheel focusin mouseenter mouseleave touchend");
|
||||
mCSB_container.unbind("touchstart touchmove")
|
||||
if(resetScroll){
|
||||
if($this.data("horizontalScroll")){
|
||||
mCSB_dragger.add(mCSB_container).css("left",0);
|
||||
}else{
|
||||
mCSB_dragger.add(mCSB_container).css("top",0);
|
||||
}
|
||||
}
|
||||
mCSB_scrollTools.css("display","none");
|
||||
mCSB_container.addClass("mCS_no_scrollbar");
|
||||
$this.data({"bindEvent_mousewheel":false,"bindEvent_focusin":false,"bindEvent_content_touch":false,"bindEvent_autoHideScrollbar":false}).addClass("mCS_disabled");
|
||||
},
|
||||
destroy:function(){
|
||||
var $this=$(this);
|
||||
$this.removeClass("mCustomScrollbar _mCS_"+$this.data("mCustomScrollbarIndex")).addClass("mCS_destroyed").children().children(".mCSB_container").unwrap().children().unwrap().siblings(".mCSB_scrollTools").remove();
|
||||
$(document).unbind("mousemove."+$this.data("mCustomScrollbarIndex")+" mouseup."+$this.data("mCustomScrollbarIndex")+" MSPointerMove."+$this.data("mCustomScrollbarIndex")+" MSPointerUp."+$this.data("mCustomScrollbarIndex"));
|
||||
$(window).unbind("resize."+$this.data("mCustomScrollbarIndex"));
|
||||
}
|
||||
},
|
||||
functions={
|
||||
/*hide/show scrollbar*/
|
||||
showScrollbar:function(){
|
||||
if($(this).css("opacity")==0){
|
||||
this.stop().animate({opacity:1},"fast");
|
||||
}
|
||||
},
|
||||
hideScrollbar:function(){
|
||||
this.stop().animate({opacity:0},"fast");
|
||||
},
|
||||
/*js animation tween*/
|
||||
mTweenAxis:function(el,prop,to,duration,easing,callbacks){
|
||||
var callbacks=callbacks || {},
|
||||
onStart=callbacks.onStart || function(){},onUpdate=callbacks.onUpdate || function(){},onComplete=callbacks.onComplete || function(){};
|
||||
var startTime=_getTime(),_delay,progress=0,from=el.offsetTop,elStyle=el.style;
|
||||
if(prop==="left"){from=el.offsetLeft;}
|
||||
var diff=to-from;
|
||||
_cancelTween();
|
||||
_startTween();
|
||||
function _getTime(){
|
||||
if(window.performance && window.performance.now){
|
||||
return window.performance.now();
|
||||
}else{
|
||||
if(window.performance && window.performance.webkitNow){
|
||||
return window.performance.webkitNow();
|
||||
}else{
|
||||
if(Date.now){return Date.now();}else{return new Date().getTime();}
|
||||
}
|
||||
}
|
||||
}
|
||||
function _step(){
|
||||
if(!progress){onStart.call();}
|
||||
progress=_getTime()-startTime;
|
||||
_tween();
|
||||
if(progress>=el._time){
|
||||
el._time=(progress>el._time) ? progress+_delay-(progress- el._time) : progress+_delay-1;
|
||||
if(el._time<progress+1){el._time=progress+1;}
|
||||
}
|
||||
if(el._time<duration){el._id=_request(_step);}else{onComplete.call();}
|
||||
}
|
||||
function _tween(){
|
||||
if(duration>0){
|
||||
el.currVal=_ease(el._time,from,diff,duration,easing);
|
||||
elStyle[prop]=Math.round(el.currVal)+"px";
|
||||
}else{
|
||||
elStyle[prop]=to+"px";
|
||||
}
|
||||
onUpdate.call();
|
||||
}
|
||||
function _startTween(){
|
||||
_delay=1000/60;
|
||||
el._time=progress+_delay;
|
||||
_request=(!window.requestAnimationFrame) ? function(f){_tween(); return setTimeout(f,0.01);} : window.requestAnimationFrame;
|
||||
el._id=_request(_step);
|
||||
}
|
||||
function _cancelTween(){
|
||||
if(el._id==null){return;}
|
||||
if(!window.requestAnimationFrame){clearTimeout(el._id);
|
||||
}else{window.cancelAnimationFrame(el._id);}
|
||||
el._id=null;
|
||||
}
|
||||
function _ease(t,b,c,d,type){
|
||||
switch(type){
|
||||
case "linear":
|
||||
return c*t/d + b;
|
||||
break;
|
||||
case "easeOutQuad":
|
||||
t /= d; return -c * t*(t-2) + b;
|
||||
break;
|
||||
case "easeInOutQuad":
|
||||
t /= d/2;
|
||||
if (t < 1) return c/2*t*t + b;
|
||||
t--;
|
||||
return -c/2 * (t*(t-2) - 1) + b;
|
||||
break;
|
||||
case "easeOutCubic":
|
||||
t /= d; t--; return c*(t*t*t + 1) + b;
|
||||
break;
|
||||
case "easeOutQuart":
|
||||
t /= d; t--; return -c * (t*t*t*t - 1) + b;
|
||||
break;
|
||||
case "easeOutQuint":
|
||||
t /= d; t--; return c*(t*t*t*t*t + 1) + b;
|
||||
break;
|
||||
case "easeOutCirc":
|
||||
t /= d; t--; return c * Math.sqrt(1 - t*t) + b;
|
||||
break;
|
||||
case "easeOutSine":
|
||||
return c * Math.sin(t/d * (Math.PI/2)) + b;
|
||||
break;
|
||||
case "easeOutExpo":
|
||||
return c * ( -Math.pow( 2, -10 * t/d ) + 1 ) + b;
|
||||
break;
|
||||
case "mcsEaseOut":
|
||||
var ts=(t/=d)*t,tc=ts*t;
|
||||
return b+c*(0.499999999999997*tc*ts + -2.5*ts*ts + 5.5*tc + -6.5*ts + 4*t);
|
||||
break;
|
||||
case "draggerRailEase":
|
||||
t /= d/2;
|
||||
if (t < 1) return c/2*t*t*t + b;
|
||||
t -= 2;
|
||||
return c/2*(t*t*t + 2) + b;
|
||||
break;
|
||||
}
|
||||
}
|
||||
},
|
||||
/*stop js animation tweens*/
|
||||
mTweenAxisStop:function(el){
|
||||
if(el._id==null){return;}
|
||||
if(!window.requestAnimationFrame){clearTimeout(el._id);
|
||||
}else{window.cancelAnimationFrame(el._id);}
|
||||
el._id=null;
|
||||
},
|
||||
/*detect requestAnimationFrame and polyfill*/
|
||||
rafPolyfill:function(){
|
||||
var pfx=["ms","moz","webkit","o"],i=pfx.length;
|
||||
while(--i > -1 && !window.requestAnimationFrame){
|
||||
window.requestAnimationFrame=window[pfx[i]+"RequestAnimationFrame"];
|
||||
window.cancelAnimationFrame=window[pfx[i]+"CancelAnimationFrame"] || window[pfx[i]+"CancelRequestAnimationFrame"];
|
||||
}
|
||||
}
|
||||
}
|
||||
/*detect features*/
|
||||
functions.rafPolyfill.call(); /*requestAnimationFrame*/
|
||||
$.support.touch=!!('ontouchstart' in window); /*touch*/
|
||||
$.support.pointer=window.navigator.pointerEnabled; /*pointer support*/
|
||||
$.support.msPointer=window.navigator.msPointerEnabled; /*MSPointer support*/
|
||||
/*plugin dependencies*/
|
||||
var _dlp=("https:"==document.location.protocol) ? "https:" : "http:";
|
||||
$.event.special.mousewheel || $("<script>",{src:_dlp+"//cdnjs.cloudflare.com/ajax/libs/jquery-mousewheel/3.1.6/jquery.mousewheel.min.js"}).appendTo("body");
|
||||
/*plugin fn*/
|
||||
$.fn.mCustomScrollbar=function(method){
|
||||
if(methods[method]){
|
||||
return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
|
||||
}else if(typeof method==="object" || !method){
|
||||
return methods.init.apply(this,arguments);
|
||||
}else{
|
||||
$.error("Method "+method+" does not exist");
|
||||
}
|
||||
};
|
||||
})(jQuery);
|
||||
File diff suppressed because one or more lines are too long
Binary file not shown.
|
Before Width: | Height: | Size: 1.4 KiB |
@ -107,7 +107,7 @@
|
||||
</div>
|
||||
</div><!-- section -->
|
||||
|
||||
<div id="task-section" class="section">
|
||||
<div id="task-section" class="section" tasks=>
|
||||
<h5>Tasks</h5>
|
||||
<div class="table-header">
|
||||
<div class="row">
|
||||
@ -117,8 +117,8 @@
|
||||
<div class="col-lg-5 col-md-5 hidden-xs hidden-sm">Host Status</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tasks-table-detail" class="table-detail" aw-custom-scroll data-on-total-scroll="TasksOnTotalScroll"
|
||||
data-on-total-scroll-back="TasksOnTotalScrollBack">
|
||||
<div id="tasks-table-detail" class="table-detail" lr-infinite-scroll="tasksScrollDown"
|
||||
scroll-threshold="10" time-threshold="500">
|
||||
<div class="row cursor-pointer"
|
||||
ng-repeat="task in taskList = (tasks | FilterById : search_all_tasks | FilterFailedEvents : liveEventProcessing : searchAllStatus) track by $index"
|
||||
ng-class="task.taskActiveClass" ng-click="selectTask(task.id)">
|
||||
@ -131,7 +131,7 @@
|
||||
<i class="fa icon-job-{{ task.status }}"></i><span ng-show="hasRoles"> {{ task.role }} </span> {{ task.name }}
|
||||
</div>
|
||||
<div class="col-lg-5 col-md-5 hidden-sm hidden-xs">
|
||||
<div class="status-bar"><div class="successful-hosts inner-bar" id="{{ task.id }}-successful-bar" aw-tool-tip="Hosts OK" data-placement="top" ng-style="task.successfulStyle">{{ task.successfulCount }}</div><div class="changed-hosts inner-bar" id="{{ task.id }}-changed-bar" aw-tool-tip="Hosts Changed" data-placement="top" ng-style="task.changedStyle">{{ task.changedCount }}</div><div class="skipped-hosts inner-bar" id="{{ task.id }}-skipped-bar" aw-tool-tip="Hosts Skipped" data-placement="top" ng-style="task.skippedStyle">{{ task.skippedCount }}</div><div class="failed-hosts inner-bar" id="{{ task.id }}-failed-bar" aw-tool-tip="Hosts Failed" data-placement="top" ng-style="task.failedStyle">{{ task.failedCount }}</div><div class="unreachable-hosts inner-bar" id="{{ task.id }}-unreachable-hosts-bar" aw-tool-tip="Hosts Unreachable" data-placement="top" ng-style="task.unreachableStyle">{{ task.unreachableCount }}</div><div class="missing-hosts inner-bar" id="{{ task.id }}-misssing-hosts-bar" ng-style="task.missingStyle">{{ task.missingCount }}</div><div class="no-matching-hosts inner-bar" id="{{ task.id }}-{{ task.play_id }}-no-matching-hosts-bar" aw-tool-tip="No matching hosts were found" data-placement="top" style="width: 100%;" ng-show="task.status === 'no-m atching-hosts'">No matching hosts</div></div>
|
||||
<div class="status-bar"><div class="successful-hosts inner-bar" id="{{ task.id }}-successful-bar" aw-tool-tip="Hosts OK" data-placement="top" ng-style="task.successfulStyle">{{ task.successfulCount }}</div><div class="changed-hosts inner-bar" id="{{ task.id }}-changed-bar" aw-tool-tip="Hosts Changed" data-placement="top" ng-style="task.changedStyle">{{ task.changedCount }}</div><div class="skipped-hosts inner-bar" id="{{ task.id }}-skipped-bar" aw-tool-tip="Hosts Skipped" data-placement="top" ng-style="task.skippedStyle">{{ task.skippedCount }}</div><div class="failed-hosts inner-bar" id="{{ task.id }}-failed-bar" aw-tool-tip="Hosts Failed" data-placement="top" ng-style="task.failedStyle">{{ task.failedCount }}</div><div class="unreachable-hosts inner-bar" id="{{ task.id }}-unreachable-hosts-bar" aw-tool-tip="Hosts Unreachable" data-placement="top" ng-style="task.unreachableStyle">{{ task.unreachableCount }}</div><div class="missing-hosts inner-bar" id="{{ task.id }}-misssing-hosts-bar" ng-style="task.missingStyle">{{ task.missingCount }}</div><div class="no-matching-hosts inner-bar" id="{{ task.id }}-{{ task.play_id }}-no-matching-hosts-bar" aw-tool-tip="No matching hosts were found" data-placement="top" style="width: 100%;" ng-show="task.status === 'no-matching-hosts'">No matching hosts</div></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" ng-show="taskList.length == 0">
|
||||
@ -140,6 +140,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scroll-spinner" id="tasksMoreRows"><i class="fa fa-cog fa-spin"></i></div>
|
||||
</div><!-- section -->
|
||||
|
||||
<div id="task-hosts-section" class="section">
|
||||
@ -151,8 +152,7 @@
|
||||
<a class="search-icon" ng-show="!searchTaskHostsEnabled" ng-click="task_host_name=''; searchTaskHosts()"><i class="fa fa-times"></i></a>
|
||||
</div>!-->
|
||||
</div>
|
||||
<div id="hosts-table-detail" aw-custom-scroll data-on-total-scroll="HostDetailOnTotalScroll"
|
||||
data-on-total-scroll-back="HostDetailOnTotalScrollBack" class="table-detail">
|
||||
<div id="hosts-table-detail" class="table-detail" lr-infinite-scroll="hostResultsScrollDown" scroll-threshold="10" time-threshold="500">
|
||||
<div id="hosts-table-detail-inner">
|
||||
<div class="row cursor-pointer" ng-repeat="result in results = (hostResults | filter:{ status : searchAllStatus}) track by $index" ng-click="viewHostResults(result.id)">
|
||||
<div class="col-lg-7 col-md-7 col-sm-7 col-xs-7 status-column">
|
||||
@ -169,8 +169,8 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scroll-spinner" id="hostResultsMoreRows"><i class="fa fa-cog fa-spin"></i></div>
|
||||
</div><!-- section -->
|
||||
|
||||
</div><!-- job-detail-tables -->
|
||||
|
||||
</div><!-- well -->
|
||||
@ -225,8 +225,7 @@
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">Completed Tasks</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="hosts-summary-table" class="table-detail" aw-custom-scroll data-on-total-scroll="HostSummaryOnTotalScroll"
|
||||
data-on-total-scroll-back="HostSummaryOnTotalScrollBack">
|
||||
<div id="hosts-summary-table" class="table-detail" lr-infinite-scroll="hostSummariesScrollDown" scroll-threshold="10" time-threshold="500">
|
||||
<div class="row" ng-repeat="host in summaryList = (hosts | filter:{ status : searchAllStatus}) track by $index" id="{{ host.id }}">
|
||||
<div class="name col-lg-6 col-md-6 col-sm-6 col-xs-6"><a ng-href="/#/job_events/{{ job.id }}/?host={{ host.name }}" target="_blank"
|
||||
aw-tool-tip="View all events for this host.<br />Opens in new tab or window." data-placement="top">{{ host.name }}</a>
|
||||
@ -244,6 +243,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="scroll-spinner" id="hostSummariesMoreRows"><i class="fa fa-cog fa-spin"></i></div>
|
||||
</div><!-- section -->
|
||||
</div><!-- summary-well-top-section -->
|
||||
|
||||
@ -258,6 +258,7 @@
|
||||
</div><!-- col-md-5 -->
|
||||
|
||||
</div>
|
||||
<div id="job-detail-footer" class="footer-row"></div>
|
||||
</div>
|
||||
|
||||
<div ng-include="'/static/partials/eventviewer.html'"></div>
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}lib/codemirror/lib/codemirror.css" />
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}lib/codemirror/theme/elegant.css" />
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}lib/codemirror/addon/lint/lint.css" />
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}lib/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css" />
|
||||
<!-- link rel="stylesheet" href="{{ STATIC_URL }}lib/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.css" -->
|
||||
<link rel="stylesheet" href="{{ STATIC_URL }}lib/novus-nvd3/nv.d3.css" type="text/css">
|
||||
|
||||
{% if settings.USE_MINIFIED_JS %}
|
||||
@ -438,13 +438,14 @@
|
||||
<script src="{{ STATIC_URL }}lib/codemirror/addon/selection/active-line.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/scrollto/lib/jquery-scrollto.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/socket.io-client/dist/socket.io.min.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/jquery-mousewheel/jquery.mousewheel.min.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.js"></script>
|
||||
<!-- <script src="{{ STATIC_URL }}lib/jquery-mousewheel/jquery.mousewheel.min.js"></script> -->
|
||||
<!-- script src="{{ STATIC_URL }}lib/malihu-custom-scrollbar-plugin/jquery.mCustomScrollbar.min.js"></script> -->
|
||||
<script scr="{{ STATIC_URL }}lib/lib/jQuery.dotdotdot/src/js/jquery.dotdotdot.min.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/d3js/build/d3.v3.min.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/novus-nvd3/nv.d3.min.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/d3Donut/d3Donut.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/jPushMenu/jPushMenu.js"></script>
|
||||
<script src="{{ STATIC_URL }}lib/lrInfiniteScroll/lrInfiniteScroll.js"></script>
|
||||
|
||||
<script>
|
||||
$('#main-menu-toggle-button').jPushMenu();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user