зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1578887 - Implement simulating viewport orientation for embedded RDM UI r=gl
Differential Revision: https://phabricator.services.mozilla.com/D51706 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
19b4d3425b
Коммит
0cd65a9ddc
|
@ -228,8 +228,8 @@ module.exports = {
|
|||
|
||||
post(window, {
|
||||
type: "viewport-resize",
|
||||
height: device.height,
|
||||
width: device.width,
|
||||
height: viewport.height,
|
||||
width: viewport.width,
|
||||
});
|
||||
post(window, {
|
||||
type: "change-device",
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const Services = require("Services");
|
||||
const asyncStorage = require("devtools/shared/async-storage");
|
||||
|
||||
const {
|
||||
|
@ -107,9 +108,21 @@ module.exports = {
|
|||
* Rotate the viewport.
|
||||
*/
|
||||
rotateViewport(id) {
|
||||
return {
|
||||
type: ROTATE_VIEWPORT,
|
||||
id,
|
||||
return async function(dispatch, getState) {
|
||||
if (Services.prefs.getBoolPref("devtools.responsive.browserUI.enabled")) {
|
||||
const viewport = getState().viewports[0];
|
||||
|
||||
post(window, {
|
||||
type: "viewport-resize",
|
||||
height: viewport.width,
|
||||
width: viewport.height,
|
||||
});
|
||||
}
|
||||
|
||||
dispatch({
|
||||
type: ROTATE_VIEWPORT,
|
||||
id,
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче