Browse Source

Added check size limit

master
Igor Zhukov 10 years ago
parent
commit
eeb52e400f
  1. 3
      app/js/directives.js

3
app/js/directives.js

@ -1531,8 +1531,9 @@ angular.module('myApp.directives', ['myApp.filters'])
var realImageWidth, realImageHeight; var realImageWidth, realImageHeight;
AppDocsManager.downloadDoc($scope.document.id).then(function (url) { AppDocsManager.downloadDoc($scope.document.id).then(function (url) {
var image = new Image(); var image = new Image();
var limit = 100; // 2 sec
var checkSizes = function (e) { var checkSizes = function (e) {
if (!image.height || !image.width) { if ((!image.height || !image.width) && --limit) {
return; return;
} }
realImageWidth = image.width; realImageWidth = image.width;

Loading…
Cancel
Save