Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
addieachan committed Jul 31, 2018
1 parent 2318049 commit 7be8afe
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions builtins/amp-img.js
Expand Up @@ -16,8 +16,8 @@

import {BaseElement} from '../src/base-element';
import {dev} from '../src/log';
import {isExperimentOn} from '../src/experiments';
import {guaranteeSrcForSrcsetUnsupportedBrowsers} from '../src/utils/img';
import {isExperimentOn} from '../src/experiments';
import {isLayoutSizeDefined} from '../src/layout';
import {listen} from '../src/event-helper';
import {registerElement} from '../src/service/custom-element-registry';
Expand Down Expand Up @@ -177,24 +177,6 @@ export class AmpImg extends BaseElement {
return true;
}

/**
* Sets the img src to the first url in the srcset if srcset is defined but
* src is not.
* @private
*/
guaranteeSrcForSrcsetUnsupportedBrowsers_() {
// The <img> tag does not have a src and does not support srcset
if (!this.img_.hasAttribute('src') && 'srcset' in this.img_ == false) {
const srcset = this.element.getAttribute('srcset');
const matches = /\S+/.exec(srcset);
if (matches == null) {
return;
}
const srcseturl = matches[0];
this.img_.setAttribute('src', srcseturl);
}
}

/**
* Checks to see if there is a placeholder that is blurred
* @private
Expand All @@ -213,10 +195,10 @@ export class AmpImg extends BaseElement {
* placeholder if one exists, or hiding the fallback if not
*/
renderImg_() {
if(this.hasBlurredPlaceHolder_){
if (this.hasBlurredPlaceHolder_) {
this.element.classList.add('i-amphtml-blur-loaded');
} else {
this.hideFallbackImg_();
this.hideFallbackImg_();
}
}

Expand Down

0 comments on commit 7be8afe

Please sign in to comment.