diff options
Diffstat (limited to 'node_modules/montage-google/youtube-channel.reel')
-rw-r--r-- | node_modules/montage-google/youtube-channel.reel/youtube-channel.js | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/node_modules/montage-google/youtube-channel.reel/youtube-channel.js b/node_modules/montage-google/youtube-channel.reel/youtube-channel.js index 18ea7923..782318f0 100644 --- a/node_modules/montage-google/youtube-channel.reel/youtube-channel.js +++ b/node_modules/montage-google/youtube-channel.reel/youtube-channel.js | |||
@@ -137,6 +137,9 @@ var YoutubeChannel = exports.YoutubeChannel = Montage.create(Component, { | |||
137 | if (this._shouldShowPopup) { | 137 | if (this._shouldShowPopup) { |
138 | this._positionPopup(); | 138 | this._positionPopup(); |
139 | 139 | ||
140 | // Need the video to be on top | ||
141 | this._element.style.zIndex = 9000; | ||
142 | |||
140 | // Fix for Canary where the thumbnail in the video doesn't | 143 | // Fix for Canary where the thumbnail in the video doesn't |
141 | // change until the CSS transition has finished, so wait for | 144 | // change until the CSS transition has finished, so wait for |
142 | // it to change before starting the animation | 145 | // it to change before starting the animation |
@@ -163,6 +166,10 @@ var YoutubeChannel = exports.YoutubeChannel = Montage.create(Component, { | |||
163 | document.removeEventListener('keyup', this); | 166 | document.removeEventListener('keyup', this); |
164 | } | 167 | } |
165 | 168 | ||
169 | // take the video from the top only once it's stopped animating | ||
170 | window.setTimeout(function() { | ||
171 | this._element.style.zIndex = null; | ||
172 | }, 500); | ||
166 | } | 173 | } |
167 | 174 | ||
168 | } | 175 | } |
@@ -175,21 +182,22 @@ var YoutubeChannel = exports.YoutubeChannel = Montage.create(Component, { | |||
175 | 182 | ||
176 | _positionPopup: { | 183 | _positionPopup: { |
177 | value: function() { | 184 | value: function() { |
185 | var doc = this._element.ownerDocument; | ||
178 | 186 | ||
179 | var viewport = this._element.parentNode; | 187 | this.player.width = doc.width; |
180 | var viewportStyle = window.getComputedStyle(viewport); | 188 | this.player.height = doc.height; |
181 | |||
182 | this.player.width = viewportStyle.width; | ||
183 | this.player.height = viewportStyle.height; | ||
184 | 189 | ||
185 | // // Chrome | 190 | // // Chrome |
186 | // viewport.insertBefore(this._popupElement, viewport.firstChild); | 191 | // viewport.insertBefore(this._popupElement, viewport.firstChild); |
187 | // this._popupElement.style.top = viewport.offsetTop; | 192 | // this._popupElement.style.top = viewport.offsetTop; |
188 | // this._popupElement.style.left = viewport.offsetLeft; | 193 | // this._popupElement.style.left = viewport.offsetLeft; |
189 | 194 | ||
195 | var computedStyle = window.getComputedStyle(doc.body); | ||
196 | |||
190 | // Canary | 197 | // Canary |
191 | this._popupElement.style.top = - (this._element.offsetTop || 0) + 'px'; | 198 | // remove the body margin |
192 | this._popupElement.style.left = - (this._element.offsetLeft || 0) + 'px'; | 199 | this._popupElement.style.top = - (this._element.offsetTop || 0) - parseInt(computedStyle.marginTop, 10) + 'px'; |
200 | this._popupElement.style.left = - (this._element.offsetLeft || 0) - parseInt(computedStyle.marginLeft, 10) + 'px'; | ||
193 | } | 201 | } |
194 | }, | 202 | }, |
195 | 203 | ||