Skip to content
Permalink
Browse files

Merge pull request #21785 from gasolin/issue-1033921

Bug 1033921 - [NFC] Shrinking UI incorrectly when using swipe gesture to..., r=alive
  • Loading branch information
gasolin committed Jul 16, 2014
2 parents 89c9bf9 + 27a7029 commit dd8a9e53a9e519e8875fd3fe1a25eec5a1ad9486
Showing with 8 additions and 2 deletions.
  1. +3 −0 apps/system/js/app_window.js
  2. +3 −0 apps/system/js/shrinking_ui.js
  3. +2 −2 apps/system/test/unit/shrinking_ui_test.js
@@ -1004,6 +1004,8 @@

AppWindow.prototype.queueShow = function aw_queueShow() {
this.element.classList.add('will-become-active');
// bug 1033921: notify current app changed
this.publish('will-become-active');
};

AppWindow.prototype.cancelQueuedShow = function aw_cancelQueuedShow() {
@@ -1012,6 +1014,7 @@

AppWindow.prototype.queueHide = function aw_queueHide() {
this.element.classList.add('will-become-inactive');
this.publish('will-become-inactive');
};

/**
@@ -86,6 +86,7 @@
window.addEventListener('appcreated', this);
window.addEventListener('appterminated', this);
window.addEventListener('appopen', this);
window.addEventListener('appwill-become-active', this);
window.addEventListener('shrinking-start', this);
window.addEventListener('shrinking-stop', this);
window.addEventListener('shrinking-receiving', this);
@@ -108,6 +109,7 @@
case 'appcreated':
case 'appterminated':
case 'appopen':
case 'appwill-become-active':
if (!evt.detail || !evt.detail.manifestURL) {
return;
}
@@ -141,6 +143,7 @@
this._unregister(evt.detail.instanceID);
break;
case 'appopen':
case 'appwill-become-active':
var config = evt.detail;
this._switchTo(config.instanceID, config.manifestURL);
break;
@@ -173,9 +173,9 @@ suite('system/ShrinkingUI', function() {
assert.isTrue(stubSwitchTo.calledWith(evt.detail.instanceID));
});

test('Handle "appopen" event', function() {
test('Handle "appwill-become-active" event', function() {
var evt = {
type: 'appopen',
type: 'appwill-become-active',
detail: {
manifestURL: 'app://www.fake.app/mfsturl',
instanceID: 'instanceID'

0 comments on commit dd8a9e5

Please sign in to comment.
You can’t perform that action at this time.