Skip to content

Commit

Permalink
Send an appkill event to know when to stop the window.top hack
Browse files Browse the repository at this point in the history
  • Loading branch information
vingtetun committed Feb 16, 2012
1 parent e0e8f88 commit b96d8b5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions apps/homescreen/js/window_manager.js
Expand Up @@ -33,6 +33,8 @@ var _statusBarHeight = null;

function Window(application, id) {
var element = this.element = document.createElement('iframe');
element.setAttribute('mozallowfullscreen', 'true');
element.setAttribute('mozbrowser', 'true');
element.id = 'window_' + id;
element.className = 'appWindow';

Expand Down Expand Up @@ -254,8 +256,12 @@ var WindowManager = {
var application = Gaia.AppManager.getInstalledAppForURL(url);
var applicationWindow = this.getWindowByApp(application);

if (applicationWindow)
this.remove(applicationWindow);
if (!applicationWindow)
return;

var name = application.name;
this._fireEvent(applicationWindow.element, 'appkill', name);
this.remove(applicationWindow);
},

_fireEvent: function wm_fireEvent(target, type, details) {
Expand Down

0 comments on commit b96d8b5

Please sign in to comment.