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 #20138 from EverythingMe/revert-hb-fix
Browse files Browse the repository at this point in the history
Bug 1021664 - Revert patch for homebutton handling while Collection is o...
  • Loading branch information
amirnissim committed Jun 8, 2014
2 parents 7c0a085 + 61e17ee commit 22b545e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 31 deletions.
14 changes: 2 additions & 12 deletions apps/verticalhome/js/app.js
Expand Up @@ -9,12 +9,9 @@
function App() {
this.scrollable = document.querySelector('.scrollable');
this.grid = document.getElementById('icons');
this.homescreenFocused = true;

window.addEventListener('hashchange', this);
window.addEventListener('gaiagrid-saveitems', this);
window.addEventListener('gaiagrid-collection-open', this);
window.addEventListener('gaiagrid-collection-close', this);
}

App.prototype = {
Expand Down Expand Up @@ -71,21 +68,14 @@
this.itemStore.save(this.grid.getItems());
break;

case 'gaiagrid-collection-open':
this.homescreenFocused = false;
break;

case 'gaiagrid-collection-close':
this.homescreenFocused = true;
break;

case 'hashchange':
if (this.grid._grid.dragdrop.inEditMode) {
this.grid._grid.dragdrop.exitEditMode();
return;
}

if (!this.homescreenFocused || document.hidden) {
// Bug 1021518 - ignore home button taps on lockscreen
if (document.hidden) {
return;
}

Expand Down
8 changes: 0 additions & 8 deletions apps/verticalhome/js/contextmenu_ui.js
@@ -1,5 +1,4 @@
'use strict';
/* global app */
/* global LazyLoader */
/* global MozActivity */
/* global wallpaper */
Expand Down Expand Up @@ -62,14 +61,7 @@
}
});

app.homescreenFocused = false;

activity.onsuccess = function onsuccess() {
app.homescreenFocused = true;
};

activity.onerror = function onerror(e) {
app.homescreenFocused = true;
if (this.error.name !== 'ActivityCanceled') {
alert(this.error.name);
}
Expand Down
1 change: 0 additions & 1 deletion apps/verticalhome/test/unit/app_test.js
Expand Up @@ -31,7 +31,6 @@ suite('app.js > ', function() {
loadBodyHTML('/index.html');
require('/js/app.js', function() {
initialize();
assert.ok(app.homescreenFocused);
done();
});
});
Expand Down
11 changes: 1 addition & 10 deletions shared/elements/gaia_grid/js/items/collection.js
Expand Up @@ -76,19 +76,10 @@
* Launches the application for this icon.
*/
launch: function() {
var activity = new MozActivity({
new MozActivity({
name: 'view-collection',
data: this.detail
});

window.dispatchEvent(new CustomEvent('gaiagrid-collection-open'));

activity.onsuccess = onClose;
activity.onerror = onClose;

function onClose() {
window.dispatchEvent(new CustomEvent('gaiagrid-collection-close'));
}
},


Expand Down

0 comments on commit 22b545e

Please sign in to comment.