Merge pull request #6073 from Snuffleupagus/bug-1170063
[Firefox] Handle the user modifying the "mousewheel.with_meta.action" and "mousewheel.with_control.action" prefs (bug 1170063)
This commit is contained in:
commit
c8c211602b
@ -423,6 +423,12 @@ ChromeActions.prototype = {
|
|||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
supportedMouseWheelZoomModifierKeys: function() {
|
||||||
|
return {
|
||||||
|
ctrlKey: getIntPref('mousewheel.with_control.action', 3) === 3,
|
||||||
|
metaKey: getIntPref('mousewheel.with_meta.action', 1) === 3,
|
||||||
|
};
|
||||||
|
},
|
||||||
reportTelemetry: function (data) {
|
reportTelemetry: function (data) {
|
||||||
var probeInfo = JSON.parse(data);
|
var probeInfo = JSON.parse(data);
|
||||||
switch (probeInfo.type) {
|
switch (probeInfo.type) {
|
||||||
@ -827,7 +833,7 @@ RequestListener.prototype.receive = function(event) {
|
|||||||
var response;
|
var response;
|
||||||
if (sync) {
|
if (sync) {
|
||||||
response = actions[action].call(this.actions, data);
|
response = actions[action].call(this.actions, data);
|
||||||
event.detail.response = response;
|
event.detail.response = makeContentReadable(response, doc.defaultView);
|
||||||
} else {
|
} else {
|
||||||
if (!event.detail.responseExpected) {
|
if (!event.detail.responseExpected) {
|
||||||
doc.documentElement.removeChild(message);
|
doc.documentElement.removeChild(message);
|
||||||
|
@ -401,6 +401,18 @@ var PDFViewerApplication = {
|
|||||||
return PDFJS.shadow(this, 'loadingBar', bar);
|
return PDFJS.shadow(this, 'loadingBar', bar);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
get supportedMouseWheelZoomModifierKeys() {
|
||||||
|
var support = {
|
||||||
|
ctrlKey: true,
|
||||||
|
metaKey: true,
|
||||||
|
};
|
||||||
|
//#if (FIREFOX || MOZCENTRAL)
|
||||||
|
// support = FirefoxCom.requestSync('supportedMouseWheelZoomModifierKeys');
|
||||||
|
//#endif
|
||||||
|
|
||||||
|
return PDFJS.shadow(this, 'supportedMouseWheelZoomModifierKeys', support);
|
||||||
|
},
|
||||||
|
|
||||||
//#if (FIREFOX || MOZCENTRAL)
|
//#if (FIREFOX || MOZCENTRAL)
|
||||||
initPassiveLoading: function pdfViewInitPassiveLoading() {
|
initPassiveLoading: function pdfViewInitPassiveLoading() {
|
||||||
function FirefoxComDataRangeTransport(length, initialData) {
|
function FirefoxComDataRangeTransport(length, initialData) {
|
||||||
@ -1898,6 +1910,11 @@ function handleMouseWheel(evt) {
|
|||||||
PDFViewerApplication.scrollPresentationMode(ticks *
|
PDFViewerApplication.scrollPresentationMode(ticks *
|
||||||
MOUSE_WHEEL_DELTA_FACTOR);
|
MOUSE_WHEEL_DELTA_FACTOR);
|
||||||
} else if (evt.ctrlKey || evt.metaKey) {
|
} else if (evt.ctrlKey || evt.metaKey) {
|
||||||
|
var support = PDFViewerApplication.supportedMouseWheelZoomModifierKeys;
|
||||||
|
if ((evt.ctrlKey && !support.ctrlKey) ||
|
||||||
|
(evt.metaKey && !support.metaKey)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Only zoom the pages, not the entire viewer.
|
// Only zoom the pages, not the entire viewer.
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user