Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #33756 from justindarc/bug1236992
Browse files Browse the repository at this point in the history
Bug 1236992 - [Music] Fix issues with rAF and <iframe> from Bug 1190093
  • Loading branch information
justindarc committed Jan 7, 2016
2 parents e2b2176 + 5fda540 commit 7d591bd
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions apps/music/elements/music-view-stack.js
Expand Up @@ -196,28 +196,26 @@ proto.destroyView = function(url) {

proto.setRootView = function(url) {
return this.loadView(url).then((view) => {
requestAnimationFrame(() => {
var oldActiveView = this.activeView;
if (oldActiveView) {
oldActiveView.frame.classList.add('fade', 'out');
oldActiveView.frame.classList.remove('active');
oldActiveView.frame.contentWindow.dispatchEvent(
new CustomEvent('viewhidden')
);
}
var oldActiveView = this.activeView;
if (oldActiveView) {
oldActiveView.frame.classList.add('fade', 'out');
oldActiveView.frame.classList.remove('active');
oldActiveView.frame.contentWindow.dispatchEvent(
new CustomEvent('viewhidden')
);
}

this.views = [view];
this.activeView = view;
this.views = [view];
this.activeView = view;

var newActiveView = this.activeView;
newActiveView.frame.classList.add('fade', 'in');
newActiveView.frame.classList.add('active');
newActiveView.frame.contentWindow.dispatchEvent(
new CustomEvent('viewvisible')
);
var newActiveView = this.activeView;
newActiveView.frame.classList.add('fade', 'in');
newActiveView.frame.classList.add('active');
newActiveView.frame.contentWindow.dispatchEvent(
new CustomEvent('viewvisible')
);

this.dispatchEvent(new CustomEvent('change', { detail: newActiveView }));
});
this.dispatchEvent(new CustomEvent('change', { detail: newActiveView }));
});
};

Expand Down

0 comments on commit 7d591bd

Please sign in to comment.