Skip to content

Commit

Permalink
fix: fix strict comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
ala-n committed Nov 23, 2020
1 parent f46b8cd commit 5462ae3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/esl-image/core/esl-image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ export class ESLImage extends ESLBaseElement {
}

public updateContainerClasses() {
if (this.containerClass == null) return;
if (this.containerClass === null) return;
const cls = this.containerClass || (this.constructor as typeof ESLImage).DEFAULT_CONTAINER_CLS;
const state = isLoadState(this.containerClassState) && this[this.containerClassState];
const targetEl = TraversingQuery.first(this.containerClassTarget, this) as HTMLElement;
Expand Down
4 changes: 2 additions & 2 deletions src/modules/esl-media-query/core/esl-media-query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class ESLMediaQuery {
// Applying dpr shortcut
this._dpr = 1;
query = query.replace(/@([123])x/, (match, ratio) => {
this._dpr = Math.floor(ratio);
this._dpr = Math.floor(ratio); // FIXME
if (ESLMediaQuery.ignoreBotsDpr && DeviceDetector.isBot && this._dpr !== 1) {
return ESLMediaQuery.NOT_ALL;
}
Expand All @@ -68,7 +68,7 @@ export class ESLMediaQuery {
query = query.replace(/(and )?(@MOBILE|@DESKTOP)( and)?/i, (match, pre, type, post) => {
this._mobileOnly = (type.toUpperCase() === '@MOBILE');
if (DeviceDetector.isMobile !== this._mobileOnly) {
return ESLMediaQuery.NOT_ALL;
return ESLMediaQuery.NOT_ALL; // whole query became invalid
}
return pre && post ? ' and ' : '';
});
Expand Down

0 comments on commit 5462ae3

Please sign in to comment.