Skip to content
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

Closed
wants to merge 2 commits into from
Closed

Conversation

dear-lizhihua
Copy link
Contributor

No description provided.

@@ -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')
Copy link
Member

@Justineo Justineo Jan 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

如果 videoModal 没取到,这里就报错了……

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

videoModal 应该不会取不到,默认就是在页面的一个
div 容器。

Copy link
Member

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

@dear-lizhihua
Copy link
Contributor Author

两种改法
要么将 videoWrapper 改成 videoModal
要么将这句顺序改到 videoWrapper 下面

@Jinjiang
Copy link
Member

Jinjiang commented Jan 10, 2018

Oops,我笔误了,本来是想写成:

var modalButton = document.getElementById('modal-player')
var videoModal = document.getElementById('video-modal')
if (!modalButton || !videoModal) {
  return
}
var videoWrapper = videoModal.querySelector('.video-space')

主要是想判断一下当前页面是不是首页
第二种改法在非首页的页面中还是会报错,因为 videoModal.querySelector 不存在

@Jinjiang
Copy link
Member

我直接线上改掉了,稍后代码会在线上生效
同时给英文站发了个 PR vuejs/v2.vuejs.org#1378 做个备忘
这里我先关掉了
感谢支持🙏

@Jinjiang Jinjiang closed this Jan 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants