diff options
author | Armen Kesablyan | 2012-06-19 01:03:59 -0700 |
---|---|---|
committer | Armen Kesablyan | 2012-06-19 01:03:59 -0700 |
commit | 2e13a73e4ee980a6f73f6ff48b2a195eb209a7db (patch) | |
tree | d352f5e769eae0e1b7b76ccbeafa9b174b1a9918 /node_modules/montage-google/youtube-channel.reel/youtube-channel.js | |
parent | 244e608645778746d1a3b5aa0d4c0868f7c5c272 (diff) | |
parent | c59eb371559a3061ce53223e249ca97daace5968 (diff) | |
download | ninja-2e13a73e4ee980a6f73f6ff48b2a195eb209a7db.tar.gz |
Merge branch 'refs/heads/master' into binding
Conflicts:
js/components/layout/tools-list.reel/tools-list.html
js/components/layout/tools-properties.reel/tools-properties.html
js/document/document-html.js
js/document/templates/app/main.js
js/panels/Panel.reel/Panel.js
node_modules/montage/ui/native-control.js
Signed-off-by: Armen Kesablyan <armen@motorola.com>
Diffstat (limited to 'node_modules/montage-google/youtube-channel.reel/youtube-channel.js')
-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 | ||