refactor: fix lint on public/js/slide.js

Signed-off-by: BoHong Li <raccoon@hackmd.io>
This commit is contained in:
BoHong Li 2019-08-02 01:03:24 +08:00
parent 3505dcb1c8
commit d3fc6f58e3
No known key found for this signature in database
GPG Key ID: 06770355DC9ECD38

View File

@ -26,7 +26,7 @@ function extend () {
for (const source of arguments) {
for (const key in source) {
if (source.hasOwnProperty(key)) {
if (Object.hasOwnProperty.call(source, key)) {
target[key] = source[key]
}
}
@ -74,17 +74,17 @@ const defaultOptions = {
const meta = JSON.parse($('#meta').text())
var options = meta.slideOptions || {}
if (options.hasOwnProperty('spotlight')) {
if (Object.hasOwnProperty.call(options, 'spotlight')) {
defaultOptions.dependencies.push({
src: `${serverurl}/build/reveal.js/plugin/spotlight/spotlight.js`
})
}
if (options.hasOwnProperty('allottedTime') || options.hasOwnProperty('allottedMinutes')) {
if (Object.hasOwnProperty.call(options, 'allottedTime') || Object.hasOwnProperty.call(options, 'allottedMinutes')) {
defaultOptions.dependencies.push({
src: `${serverurl}/build/reveal.js/plugin/elapsed-time-bar/elapsed-time-bar.js`
})
if (options.hasOwnProperty('allottedMinutes')) {
if (Object.hasOwnProperty.call(options, 'allottedMinutes')) {
options.allottedTime = options.allottedMinutes * 60 * 1000
}
}
@ -123,14 +123,14 @@ window.viewAjaxCallback = () => {
function renderSlide (event) {
if (window.location.search.match(/print-pdf/gi)) {
const slides = $('.slides')
let title = document.title
const title = document.title
finishView(slides)
document.title = title
Reveal.layout()
} else {
const markdown = $(event.currentSlide)
if (!markdown.attr('data-rendered')) {
let title = document.title
const title = document.title
finishView(markdown)
markdown.attr('data-rendered', 'true')
document.title = title