mirror of
https://github.com/ansible/awx.git
synced 2026-01-21 06:28:01 -03:30
Use jquery for resize binding
This commit is contained in:
parent
6046419e2d
commit
64484c4054
@ -26,7 +26,7 @@
|
||||
*
|
||||
*/
|
||||
function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, DashboardCounts, DashboardJobs,
|
||||
ClearScope, Stream, Rest, GetBasePath, ProcessErrors, Button, graphData){
|
||||
ClearScope, Stream, Rest, GetBasePath, ProcessErrors, Button, $window, graphData){
|
||||
|
||||
ClearScope('home');
|
||||
|
||||
@ -64,7 +64,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
||||
e.html(html);
|
||||
$compile(e)($scope);
|
||||
|
||||
waitCount = 4;
|
||||
waitCount = 3;
|
||||
loadedCount = 0;
|
||||
|
||||
if (!$routeParams.login) {
|
||||
@ -83,10 +83,12 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
||||
}
|
||||
loadedCount++;
|
||||
if (loadedCount === waitCount) {
|
||||
$(window).resize(_.debounce(function() {
|
||||
Wait('stop');
|
||||
}, 500));
|
||||
$(window).resize();
|
||||
// console.log('binding to resize');
|
||||
// angular.element($window).on('resize', _.debounce(function() {
|
||||
// console.log('resize from controller');
|
||||
// Wait('stop');
|
||||
// }, 500));
|
||||
// $(window).resize();
|
||||
}
|
||||
});
|
||||
|
||||
@ -170,7 +172,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
||||
}
|
||||
|
||||
Home.$inject = ['$scope', '$compile', '$routeParams', '$rootScope', '$location', '$log','Wait', 'DashboardCounts', 'DashboardJobs',
|
||||
'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', 'Button', 'graphData'
|
||||
'ClearScope', 'Stream', 'Rest', 'GetBasePath', 'ProcessErrors', 'Button', '$window', 'graphData'
|
||||
];
|
||||
|
||||
|
||||
|
||||
@ -12,10 +12,16 @@ angular.module('DashboardGraphs').
|
||||
|
||||
url = getBasePath('config');
|
||||
|
||||
$window.addEventListener('resize', function() {
|
||||
angular.element($window).on('resize', function(e) {
|
||||
if(!license_graph) return;
|
||||
adjustGraphSize(license_graph, element);
|
||||
});
|
||||
|
||||
element.on('$destroy', function() {
|
||||
angular.element($window).off('resize', adjustGraphSize);
|
||||
});
|
||||
|
||||
|
||||
Rest.setUrl(url);
|
||||
Rest.get()
|
||||
.success(function (data){
|
||||
|
||||
@ -29,10 +29,10 @@ angular.module('DashboardGraphs')
|
||||
host_pie_chart.update();
|
||||
}
|
||||
|
||||
$window.addEventListener('resize', adjustGraphSize);
|
||||
angular.element($window).on('resize', adjustGraphSize);
|
||||
|
||||
element.on('$destroy', function() {
|
||||
$window.removeEventListener('resize', adjustGraphSize);
|
||||
angular.element($window).off('resize', adjustGraphSize);
|
||||
});
|
||||
|
||||
function buildGraph(data) {
|
||||
|
||||
@ -36,10 +36,14 @@ angular.module('DashboardGraphs')
|
||||
var w = angular.element($window);
|
||||
|
||||
|
||||
$window.addEventListener('resize', function() {
|
||||
angular.element($window).on('resize', function() {
|
||||
adjustGraphSize(job_status_chart, element);
|
||||
});
|
||||
|
||||
element.on('$destroy', function() {
|
||||
angular.element($window).off('resize', adjustGraphSize);
|
||||
});
|
||||
|
||||
if (scope.removeGraphDataReady) {
|
||||
scope.removeGraphDataReady();
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user