aboutsummaryrefslogtreecommitdiff
path: root/node_modules/montage-google/youtube-channel.reel
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/montage-google/youtube-channel.reel')
-rw-r--r--node_modules/montage-google/youtube-channel.reel/youtube-channel.html4
-rw-r--r--node_modules/montage-google/youtube-channel.reel/youtube-channel.js22
2 files changed, 17 insertions, 9 deletions
diff --git a/node_modules/montage-google/youtube-channel.reel/youtube-channel.html b/node_modules/montage-google/youtube-channel.reel/youtube-channel.html
index 99a8a698..112fda72 100644
--- a/node_modules/montage-google/youtube-channel.reel/youtube-channel.html
+++ b/node_modules/montage-google/youtube-channel.reel/youtube-channel.html
@@ -10,7 +10,7 @@
10 <script type="text/montage-serialization"> 10 <script type="text/montage-serialization">
11 { 11 {
12 "player": { 12 "player": {
13 "prototype": "montage-google/youtube-player.reel", 13 "prototype": "youtube-player.reel",
14 "properties": { 14 "properties": {
15 "element": {"#": "player"} 15 "element": {"#": "player"}
16 } 16 }
@@ -41,7 +41,7 @@
41 }, 41 },
42 42
43 "owner": { 43 "owner": {
44 "module": "montage-google/youtube-channel.reel", 44 "module": "youtube-channel.reel",
45 "name": "YoutubeChannel", 45 "name": "YoutubeChannel",
46 "properties": { 46 "properties": {
47 "element": {"#": "container"}, 47 "element": {"#": "container"},
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