feat(rendering): fixed issue with png rendering, recently introduced by profiler refactoring

This commit is contained in:
Torkel Ödegaard 2016-06-17 08:49:11 +02:00
parent 5c35fac8fe
commit 23aa614baf
2 changed files with 6 additions and 6 deletions

View File

@ -99,7 +99,9 @@ export class Profiler {
}
renderingCompleted(panelId, panelTimings) {
this.panelsRendered++;
// add render counter to root scope
// used by phantomjs render.js to know when panel has rendered
this.$rootScope.panelsRendered = this.panelsRendered++;
if (this.enabled) {
panelTimings.renderEnd = new Date().getTime();

View File

@ -36,7 +36,7 @@
// console.log('Loading a web page: ' + params.url + ' status: ' + status);
function checkIsReady() {
var canvas = page.evaluate(function() {
var panelsRendered = page.evaluate(function() {
if (!window.angular) { return false; }
var body = window.angular.element(document.body);
if (!body.injector) { return false; }
@ -44,12 +44,10 @@
var rootScope = body.injector().get('$rootScope');
if (!rootScope) {return false;}
if (!rootScope.performance) { return false; }
var panelsToLoad = window.angular.element('div.panel').length;
return rootScope.performance.panelsRendered >= panelsToLoad;
return rootScope.panelsRendered;
});
if (canvas || tries === 1000) {
if (panelsRendered || tries === 1000) {
var bb = page.evaluate(function () {
return document.getElementsByClassName("main-view")[0].getBoundingClientRect();
});