Bug 465265 - Support swipe gestures in View Source windows on Mac OS X. r=gavin, ui-r=faaborg

This commit is contained in:
Tom Dyas 2009-11-06 17:38:22 +01:00
Родитель 7085dcaf5b
Коммит 5cade98966
1 изменённых файлов: 19 добавлений и 0 удалений

Просмотреть файл

@ -232,6 +232,7 @@ function viewSource(url)
}
window.addEventListener("AppCommand", HandleAppCommandEvent, true);
window.addEventListener("MozSwipeGesture", HandleSwipeGesture, true);
window.content.focus();
}
@ -283,6 +284,24 @@ function HandleAppCommandEvent(evt)
}
}
function HandleSwipeGesture(evt) {
evt.stopPropagation();
switch (evt.direction) {
case SimpleGestureEvent.DIRECTION_LEFT:
BrowserBack();
break;
case SimpleGestureEvent.DIRECTION_RIGHT:
BrowserForward();
break;
case SimpleGestureEvent.DIRECTION_UP:
goDoCommand("cmd_scrollTop");
break;
case SimpleGestureEvent.DIRECTION_DOWN:
goDoCommand("cmd_scrollBottom");
break;
}
}
function ViewSourceClose()
{
window.close();