Skip to content

Commit

Permalink
fix wrong image dimensions (danialfarid#1490)
Browse files Browse the repository at this point in the history
jqLite .css() function has problems with `!important`. See e.g.:
angular/angular.js#5379
  • Loading branch information
thegitfather committed May 3, 2016
1 parent 40ddf26 commit a04d2d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/validate.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,8 +333,8 @@ ngFileUpload.service('UploadValidate', ['UploadDataUrl', '$q', '$timeout', funct
}
upload.dataUrl(file).then(function (dataUrl) {
var img = angular.element('<img>').attr('src', dataUrl)
.css('visibility', 'hidden').css('position', 'fixed')
.css('max-width', 'none !important').css('max-height', 'none !important');
.css('visibility', 'hidden').css('position', 'fixed');
img[0].setAttribute('style', 'max-width: none !important; max-height: none !important;');

function success() {
var width = img[0].clientWidth;
Expand Down

0 comments on commit a04d2d3

Please sign in to comment.