Formatting fixes
This commit is contained in:
parent
da943b384c
commit
d06881783d
@ -35,7 +35,7 @@
|
|||||||
"lint:fix": "eslint --fix src/js",
|
"lint:fix": "eslint --fix src/js",
|
||||||
"remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'",
|
"remark": "remark -f --use 'validate-links=repository:\"sampotts/plyr\"' '{,!(node_modules),.?**/}*.md'",
|
||||||
"deploy": "yarn lint && gulp version && gulp build && gulp deploy",
|
"deploy": "yarn lint && gulp version && gulp build && gulp deploy",
|
||||||
"prettier": "prettier --write ./src/js/*.js"
|
"format": "prettier --write ./src/js/**/*.js"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"ansi-colors": "^4.1.1",
|
"ansi-colors": "^4.1.1",
|
||||||
|
@ -628,7 +628,10 @@ class PreviewThumbnails {
|
|||||||
}
|
}
|
||||||
|
|
||||||
determineContainerAutoSizing() {
|
determineContainerAutoSizing() {
|
||||||
if (this.elements.thumb.imageContainer.clientHeight > 20 || this.elements.thumb.imageContainer.clientWidth > 20) {
|
if (
|
||||||
|
this.elements.thumb.imageContainer.clientHeight > 20 ||
|
||||||
|
this.elements.thumb.imageContainer.clientWidth > 20
|
||||||
|
) {
|
||||||
// This will prevent auto sizing in this.setThumbContainerSizeAndPos()
|
// This will prevent auto sizing in this.setThumbContainerSizeAndPos()
|
||||||
this.sizeSpecifiedInCSS = true;
|
this.sizeSpecifiedInCSS = true;
|
||||||
}
|
}
|
||||||
@ -640,10 +643,16 @@ class PreviewThumbnails {
|
|||||||
const thumbWidth = Math.floor(this.thumbContainerHeight * this.thumbAspectRatio);
|
const thumbWidth = Math.floor(this.thumbContainerHeight * this.thumbAspectRatio);
|
||||||
this.elements.thumb.imageContainer.style.height = `${this.thumbContainerHeight}px`;
|
this.elements.thumb.imageContainer.style.height = `${this.thumbContainerHeight}px`;
|
||||||
this.elements.thumb.imageContainer.style.width = `${thumbWidth}px`;
|
this.elements.thumb.imageContainer.style.width = `${thumbWidth}px`;
|
||||||
} else if (this.elements.thumb.imageContainer.clientHeight > 20 && this.elements.thumb.imageContainer.clientWidth < 20) {
|
} else if (
|
||||||
|
this.elements.thumb.imageContainer.clientHeight > 20 &&
|
||||||
|
this.elements.thumb.imageContainer.clientWidth < 20
|
||||||
|
) {
|
||||||
const thumbWidth = Math.floor(this.elements.thumb.imageContainer.clientHeight * this.thumbAspectRatio);
|
const thumbWidth = Math.floor(this.elements.thumb.imageContainer.clientHeight * this.thumbAspectRatio);
|
||||||
this.elements.thumb.imageContainer.style.width = `${thumbWidth}px`;
|
this.elements.thumb.imageContainer.style.width = `${thumbWidth}px`;
|
||||||
} else if (this.elements.thumb.imageContainer.clientHeight < 20 && this.elements.thumb.imageContainer.clientWidth > 20) {
|
} else if (
|
||||||
|
this.elements.thumb.imageContainer.clientHeight < 20 &&
|
||||||
|
this.elements.thumb.imageContainer.clientWidth > 20
|
||||||
|
) {
|
||||||
const thumbHeight = Math.floor(this.elements.thumb.imageContainer.clientWidth / this.thumbAspectRatio);
|
const thumbHeight = Math.floor(this.elements.thumb.imageContainer.clientWidth / this.thumbAspectRatio);
|
||||||
this.elements.thumb.imageContainer.style.height = `${thumbHeight}px`;
|
this.elements.thumb.imageContainer.style.height = `${thumbHeight}px`;
|
||||||
}
|
}
|
||||||
|
@ -201,13 +201,16 @@ const vimeo = {
|
|||||||
return speed;
|
return speed;
|
||||||
},
|
},
|
||||||
set(input) {
|
set(input) {
|
||||||
player.embed.setPlaybackRate(input).then(() => {
|
player.embed
|
||||||
speed = input;
|
.setPlaybackRate(input)
|
||||||
triggerEvent.call(player, player.media, 'ratechange');
|
.then(() => {
|
||||||
}).catch(() => {
|
speed = input;
|
||||||
// Cannot set Playback Rate, Video is probably not on Pro account
|
triggerEvent.call(player, player.media, 'ratechange');
|
||||||
player.options.speed = [1];
|
})
|
||||||
});
|
.catch(() => {
|
||||||
|
// Cannot set Playback Rate, Video is probably not on Pro account
|
||||||
|
player.options.speed = [1];
|
||||||
|
});
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -221,7 +221,7 @@ export function hasClass(element, className) {
|
|||||||
|
|
||||||
// Element matches selector
|
// Element matches selector
|
||||||
export function matches(element, selector) {
|
export function matches(element, selector) {
|
||||||
const {prototype} = Element;
|
const { prototype } = Element;
|
||||||
|
|
||||||
function match() {
|
function match() {
|
||||||
return Array.from(document.querySelectorAll(selector)).includes(this);
|
return Array.from(document.querySelectorAll(selector)).includes(this);
|
||||||
|
@ -90,7 +90,7 @@ export function triggerEvent(element, type = '', bubbles = false, detail = {}) {
|
|||||||
// Create and dispatch the event
|
// Create and dispatch the event
|
||||||
const event = new CustomEvent(type, {
|
const event = new CustomEvent(type, {
|
||||||
bubbles,
|
bubbles,
|
||||||
detail: { ...detail, plyr: this,},
|
detail: { ...detail, plyr: this },
|
||||||
});
|
});
|
||||||
|
|
||||||
// Dispatch the event
|
// Dispatch the event
|
||||||
|
Loading…
x
Reference in New Issue
Block a user