mirror of
https://github.com/ansible/awx.git
synced 2026-05-19 14:57:39 -02:30
Use jquery for resize binding
This commit is contained in:
@@ -26,7 +26,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait, DashboardCounts, DashboardJobs,
|
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');
|
ClearScope('home');
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
|||||||
e.html(html);
|
e.html(html);
|
||||||
$compile(e)($scope);
|
$compile(e)($scope);
|
||||||
|
|
||||||
waitCount = 4;
|
waitCount = 3;
|
||||||
loadedCount = 0;
|
loadedCount = 0;
|
||||||
|
|
||||||
if (!$routeParams.login) {
|
if (!$routeParams.login) {
|
||||||
@@ -83,10 +83,12 @@ function Home($scope, $compile, $routeParams, $rootScope, $location, $log, Wait,
|
|||||||
}
|
}
|
||||||
loadedCount++;
|
loadedCount++;
|
||||||
if (loadedCount === waitCount) {
|
if (loadedCount === waitCount) {
|
||||||
$(window).resize(_.debounce(function() {
|
// console.log('binding to resize');
|
||||||
Wait('stop');
|
// angular.element($window).on('resize', _.debounce(function() {
|
||||||
}, 500));
|
// console.log('resize from controller');
|
||||||
$(window).resize();
|
// 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',
|
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');
|
url = getBasePath('config');
|
||||||
|
|
||||||
$window.addEventListener('resize', function() {
|
angular.element($window).on('resize', function(e) {
|
||||||
|
if(!license_graph) return;
|
||||||
adjustGraphSize(license_graph, element);
|
adjustGraphSize(license_graph, element);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
element.on('$destroy', function() {
|
||||||
|
angular.element($window).off('resize', adjustGraphSize);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
Rest.setUrl(url);
|
Rest.setUrl(url);
|
||||||
Rest.get()
|
Rest.get()
|
||||||
.success(function (data){
|
.success(function (data){
|
||||||
|
|||||||
@@ -29,10 +29,10 @@ angular.module('DashboardGraphs')
|
|||||||
host_pie_chart.update();
|
host_pie_chart.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
$window.addEventListener('resize', adjustGraphSize);
|
angular.element($window).on('resize', adjustGraphSize);
|
||||||
|
|
||||||
element.on('$destroy', function() {
|
element.on('$destroy', function() {
|
||||||
$window.removeEventListener('resize', adjustGraphSize);
|
angular.element($window).off('resize', adjustGraphSize);
|
||||||
});
|
});
|
||||||
|
|
||||||
function buildGraph(data) {
|
function buildGraph(data) {
|
||||||
|
|||||||
@@ -36,10 +36,14 @@ angular.module('DashboardGraphs')
|
|||||||
var w = angular.element($window);
|
var w = angular.element($window);
|
||||||
|
|
||||||
|
|
||||||
$window.addEventListener('resize', function() {
|
angular.element($window).on('resize', function() {
|
||||||
adjustGraphSize(job_status_chart, element);
|
adjustGraphSize(job_status_chart, element);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
element.on('$destroy', function() {
|
||||||
|
angular.element($window).off('resize', adjustGraphSize);
|
||||||
|
});
|
||||||
|
|
||||||
if (scope.removeGraphDataReady) {
|
if (scope.removeGraphDataReady) {
|
||||||
scope.removeGraphDataReady();
|
scope.removeGraphDataReady();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user