-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
官方视频改为优酷视频的代码写错,导致无法观看视频 #644
Conversation
themes/vue/source/js/common.js
Outdated
@@ -146,10 +146,10 @@ | |||
function initVideoModal () { | |||
var modalButton = document.getElementById('modal-player') | |||
var videoModal = document.getElementById('video-modal') | |||
if (!modalButton || !videoModal) { | |||
var videoWrapper = videoModal.querySelector('.video-space') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果 videoModal
没取到,这里就报错了……
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
videoModal 应该不会取不到,默认就是在页面的一个
div 容器。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
内容页用的是同一个 common.js
,是没有这个元素的。
要不就这样:
var modalButton = document.getElementById('modal-player')
var videoModal = document.getElementById('video-modal')
var videoWrapper = document.querySelector('#video-modal .video-space')
if (!modalButton || !videoModal || !videoModal) {
return
}
/ping @Jinjiang
两种改法 |
Oops,我笔误了,本来是想写成: var modalButton = document.getElementById('modal-player')
var videoModal = document.getElementById('video-modal')
if (!modalButton || !videoModal) {
return
}
var videoWrapper = videoModal.querySelector('.video-space') 主要是想判断一下当前页面是不是首页 |
我直接线上改掉了,稍后代码会在线上生效 |
No description provided.