зеркало из https://github.com/mozilla/pjs.git
Bug 465265 - Support swipe gestures in View Source windows on Mac OS X. r=gavin, ui-r=faaborg
This commit is contained in:
Родитель
7085dcaf5b
Коммит
5cade98966
|
@ -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();
|
||||
|
|
Загрузка…
Ссылка в новой задаче