# gesture_mappings

name: Zurück & schließen
direction: L
command:
var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
                   .getService(Components.interfaces.nsIWindowMediator);
var enumerator = wm.getEnumerator(null);
var winCount = 0;
var myWindow;
while(enumerator.hasMoreElements()) {
  myWindow = enumerator.getNext();
  winCount++;
}

if (getBrowser().canGoBack)
    //getBrowser().goBack();
    BrowserBack();
else if (getBrowser().mTabContainer.childNodes.length == 1)
{
    if (winCount > 1)
        window.close();
    else
    {
        getBrowser().removeTab(getBrowser().selectedTab);
        setTimeout(myWindow.minimize, 10);
   }
}
else
    getBrowser().removeTab(getBrowser().selectedTab);


