Skip to content

Commit d3fc6f5

Browse files
committed
refactor: fix lint on public/js/slide.js
Signed-off-by: BoHong Li <[email protected]>
1 parent 3505dcb commit d3fc6f5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

public/js/slide.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function extend () {
2626

2727
for (const source of arguments) {
2828
for (const key in source) {
29-
if (source.hasOwnProperty(key)) {
29+
if (Object.hasOwnProperty.call(source, key)) {
3030
target[key] = source[key]
3131
}
3232
}
@@ -74,17 +74,17 @@ const defaultOptions = {
7474
const meta = JSON.parse($('#meta').text())
7575
var options = meta.slideOptions || {}
7676

77-
if (options.hasOwnProperty('spotlight')) {
77+
if (Object.hasOwnProperty.call(options, 'spotlight')) {
7878
defaultOptions.dependencies.push({
7979
src: `${serverurl}/build/reveal.js/plugin/spotlight/spotlight.js`
8080
})
8181
}
8282

83-
if (options.hasOwnProperty('allottedTime') || options.hasOwnProperty('allottedMinutes')) {
83+
if (Object.hasOwnProperty.call(options, 'allottedTime') || Object.hasOwnProperty.call(options, 'allottedMinutes')) {
8484
defaultOptions.dependencies.push({
8585
src: `${serverurl}/build/reveal.js/plugin/elapsed-time-bar/elapsed-time-bar.js`
8686
})
87-
if (options.hasOwnProperty('allottedMinutes')) {
87+
if (Object.hasOwnProperty.call(options, 'allottedMinutes')) {
8888
options.allottedTime = options.allottedMinutes * 60 * 1000
8989
}
9090
}
@@ -123,14 +123,14 @@ window.viewAjaxCallback = () => {
123123
function renderSlide (event) {
124124
if (window.location.search.match(/print-pdf/gi)) {
125125
const slides = $('.slides')
126-
let title = document.title
126+
const title = document.title
127127
finishView(slides)
128128
document.title = title
129129
Reveal.layout()
130130
} else {
131131
const markdown = $(event.currentSlide)
132132
if (!markdown.attr('data-rendered')) {
133-
let title = document.title
133+
const title = document.title
134134
finishView(markdown)
135135
markdown.attr('data-rendered', 'true')
136136
document.title = title

0 commit comments

Comments
 (0)