aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-06-15 11:31:51 -0700
committerJose Antonio Marquez2012-06-15 11:31:51 -0700
commit473f5941ad518f6efe69d3924734c2cd434316db (patch)
treed73a998304b905f39f69eb5df2b9b9c332d596bc
parentb39e13b9a53e6c75f4f9364e686dc90df02b09bb (diff)
parent5bbc18640934798702b0979324c565d77b347219 (diff)
downloadninja-473f5941ad518f6efe69d3924734c2cd434316db.tar.gz
Merge branch 'refs/heads/Ninja-Internal' into FileIO
-rw-r--r--node_modules/montage-google/youtube-channel.reel/youtube-channel.js22
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