mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-11 12:25:53 +00:00
Bug 1321675 - Rename removeDevice to removeDeviceAssoc. r=gl
MozReview-Commit-ID: 1UMUfX23zUb --HG-- extra : rebase_source : 369e0ede8a58af9242e1a98bb2b536efd4193794
This commit is contained in:
parent
73f556c0e6
commit
1566515dfe
@ -54,7 +54,7 @@ createEnum([
|
||||
"LOAD_DEVICE_LIST_END",
|
||||
|
||||
// Remove the viewport's device assocation.
|
||||
"REMOVE_DEVICE",
|
||||
"REMOVE_DEVICE_ASSOCIATION",
|
||||
|
||||
// Resize the viewport.
|
||||
"RESIZE_VIEWPORT",
|
||||
|
@ -8,7 +8,7 @@ const {
|
||||
ADD_VIEWPORT,
|
||||
CHANGE_DEVICE,
|
||||
CHANGE_PIXEL_RATIO,
|
||||
REMOVE_DEVICE,
|
||||
REMOVE_DEVICE_ASSOCIATION,
|
||||
RESIZE_VIEWPORT,
|
||||
ROTATE_VIEWPORT
|
||||
} = require("./index");
|
||||
@ -50,9 +50,9 @@ module.exports = {
|
||||
/**
|
||||
* Remove the viewport's device assocation.
|
||||
*/
|
||||
removeDevice(id) {
|
||||
removeDeviceAssociation(id) {
|
||||
return {
|
||||
type: REMOVE_DEVICE,
|
||||
type: REMOVE_DEVICE_ASSOCIATION,
|
||||
id,
|
||||
};
|
||||
},
|
||||
|
@ -21,7 +21,7 @@ const { changeTouchSimulation } = require("./actions/touch-simulation");
|
||||
const {
|
||||
changeDevice,
|
||||
changePixelRatio,
|
||||
removeDevice,
|
||||
removeDeviceAssociation,
|
||||
resizeViewport,
|
||||
rotateViewport,
|
||||
} = require("./actions/viewports");
|
||||
@ -99,12 +99,12 @@ let App = createClass({
|
||||
window.postMessage({ type: "exit" }, "*");
|
||||
},
|
||||
|
||||
onRemoveDevice(id) {
|
||||
onRemoveDeviceAssociation(id) {
|
||||
// TODO: Bug 1332754: Move messaging and logic into the action creator.
|
||||
window.postMessage({
|
||||
type: "remove-device",
|
||||
type: "remove-device-association",
|
||||
}, "*");
|
||||
this.props.dispatch(removeDevice(id));
|
||||
this.props.dispatch(removeDeviceAssociation(id));
|
||||
this.props.dispatch(changeTouchSimulation(false));
|
||||
this.props.dispatch(changePixelRatio(id, 0));
|
||||
},
|
||||
@ -149,7 +149,7 @@ let App = createClass({
|
||||
onContentResize,
|
||||
onDeviceListUpdate,
|
||||
onExit,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
onResizeViewport,
|
||||
onRotateViewport,
|
||||
onScreenshot,
|
||||
@ -196,7 +196,7 @@ let App = createClass({
|
||||
onBrowserMounted,
|
||||
onChangeDevice,
|
||||
onContentResize,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
onRotateViewport,
|
||||
onResizeViewport,
|
||||
onUpdateDeviceModal,
|
||||
|
@ -117,7 +117,7 @@ module.exports = createClass({
|
||||
width: normalizedViewport.width,
|
||||
height: normalizedViewport.height,
|
||||
},
|
||||
onRemoveDevice: () => {},
|
||||
onRemoveDeviceAssociation: () => {},
|
||||
onResizeViewport: () => {},
|
||||
})
|
||||
),
|
||||
|
@ -30,7 +30,7 @@ module.exports = createClass({
|
||||
onBrowserMounted: PropTypes.func.isRequired,
|
||||
onChangeDevice: PropTypes.func.isRequired,
|
||||
onContentResize: PropTypes.func.isRequired,
|
||||
onRemoveDevice: PropTypes.func.isRequired,
|
||||
onRemoveDeviceAssociation: PropTypes.func.isRequired,
|
||||
onResizeViewport: PropTypes.func.isRequired,
|
||||
onRotateViewport: PropTypes.func.isRequired,
|
||||
onUpdateDeviceModal: PropTypes.func.isRequired,
|
||||
@ -114,7 +114,7 @@ module.exports = createClass({
|
||||
// the properties of the device on resize. However, at the moment, there is no
|
||||
// way to edit dPR when a device is selected, and there is no UI at all for editing
|
||||
// UA, so it's important to keep doing this for now.
|
||||
this.props.onRemoveDevice();
|
||||
this.props.onRemoveDeviceAssociation();
|
||||
}
|
||||
|
||||
this.setState({
|
||||
|
@ -15,7 +15,7 @@ module.exports = createClass({
|
||||
|
||||
propTypes: {
|
||||
viewport: PropTypes.shape(Types.viewport).isRequired,
|
||||
onRemoveDevice: PropTypes.func.isRequired,
|
||||
onRemoveDeviceAssociation: PropTypes.func.isRequired,
|
||||
onResizeViewport: PropTypes.func.isRequired,
|
||||
},
|
||||
|
||||
@ -116,7 +116,7 @@ module.exports = createClass({
|
||||
// Change the device selector back to an unselected device
|
||||
// TODO: Bug 1332754: Logic like this probably belongs in the action creator.
|
||||
if (this.props.viewport.device) {
|
||||
this.props.onRemoveDevice();
|
||||
this.props.onRemoveDeviceAssociation();
|
||||
}
|
||||
this.props.onResizeViewport(parseInt(this.state.width, 10),
|
||||
parseInt(this.state.height, 10));
|
||||
|
@ -24,7 +24,7 @@ module.exports = createClass({
|
||||
onBrowserMounted: PropTypes.func.isRequired,
|
||||
onChangeDevice: PropTypes.func.isRequired,
|
||||
onContentResize: PropTypes.func.isRequired,
|
||||
onRemoveDevice: PropTypes.func.isRequired,
|
||||
onRemoveDeviceAssociation: PropTypes.func.isRequired,
|
||||
onResizeViewport: PropTypes.func.isRequired,
|
||||
onRotateViewport: PropTypes.func.isRequired,
|
||||
onUpdateDeviceModal: PropTypes.func.isRequired,
|
||||
@ -39,13 +39,13 @@ module.exports = createClass({
|
||||
onChangeDevice(viewport.id, device, deviceType);
|
||||
},
|
||||
|
||||
onRemoveDevice() {
|
||||
onRemoveDeviceAssociation() {
|
||||
let {
|
||||
viewport,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
} = this.props;
|
||||
|
||||
onRemoveDevice(viewport.id);
|
||||
onRemoveDeviceAssociation(viewport.id);
|
||||
},
|
||||
|
||||
onResizeViewport(width, height) {
|
||||
@ -80,7 +80,7 @@ module.exports = createClass({
|
||||
|
||||
let {
|
||||
onChangeDevice,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
onRotateViewport,
|
||||
onResizeViewport,
|
||||
} = this;
|
||||
@ -91,7 +91,7 @@ module.exports = createClass({
|
||||
},
|
||||
ViewportDimension({
|
||||
viewport,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
onResizeViewport,
|
||||
}),
|
||||
ResizableViewport({
|
||||
@ -103,7 +103,7 @@ module.exports = createClass({
|
||||
onBrowserMounted,
|
||||
onChangeDevice,
|
||||
onContentResize,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
onResizeViewport,
|
||||
onRotateViewport,
|
||||
onUpdateDeviceModal,
|
||||
|
@ -22,7 +22,7 @@ module.exports = createClass({
|
||||
onBrowserMounted: PropTypes.func.isRequired,
|
||||
onChangeDevice: PropTypes.func.isRequired,
|
||||
onContentResize: PropTypes.func.isRequired,
|
||||
onRemoveDevice: PropTypes.func.isRequired,
|
||||
onRemoveDeviceAssociation: PropTypes.func.isRequired,
|
||||
onResizeViewport: PropTypes.func.isRequired,
|
||||
onRotateViewport: PropTypes.func.isRequired,
|
||||
onUpdateDeviceModal: PropTypes.func.isRequired,
|
||||
@ -37,7 +37,7 @@ module.exports = createClass({
|
||||
onBrowserMounted,
|
||||
onChangeDevice,
|
||||
onContentResize,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
onResizeViewport,
|
||||
onRotateViewport,
|
||||
onUpdateDeviceModal,
|
||||
@ -58,7 +58,7 @@ module.exports = createClass({
|
||||
onBrowserMounted,
|
||||
onChangeDevice,
|
||||
onContentResize,
|
||||
onRemoveDevice,
|
||||
onRemoveDeviceAssociation,
|
||||
onResizeViewport,
|
||||
onRotateViewport,
|
||||
onUpdateDeviceModal,
|
||||
|
@ -467,8 +467,8 @@ ResponsiveUI.prototype = {
|
||||
case "exit":
|
||||
this.onExit();
|
||||
break;
|
||||
case "remove-device":
|
||||
this.onRemoveDevice(event);
|
||||
case "remove-device-association":
|
||||
this.onRemoveDeviceAssociation(event);
|
||||
break;
|
||||
}
|
||||
},
|
||||
@ -512,7 +512,7 @@ ResponsiveUI.prototype = {
|
||||
ResponsiveUIManager.closeIfNeeded(browserWindow, tab);
|
||||
},
|
||||
|
||||
onRemoveDevice: Task.async(function* (event) {
|
||||
onRemoveDeviceAssociation: Task.async(function* (event) {
|
||||
yield this.updateUserAgent();
|
||||
yield this.updateDPPX();
|
||||
yield this.updateTouchSimulation();
|
||||
|
@ -8,7 +8,7 @@ const {
|
||||
ADD_VIEWPORT,
|
||||
CHANGE_DEVICE,
|
||||
CHANGE_PIXEL_RATIO,
|
||||
REMOVE_DEVICE,
|
||||
REMOVE_DEVICE_ASSOCIATION,
|
||||
RESIZE_VIEWPORT,
|
||||
ROTATE_VIEWPORT,
|
||||
} = require("../actions/index");
|
||||
@ -64,7 +64,7 @@ let reducers = {
|
||||
});
|
||||
},
|
||||
|
||||
[REMOVE_DEVICE](viewports, { id }) {
|
||||
[REMOVE_DEVICE_ASSOCIATION](viewports, { id }) {
|
||||
return viewports.map(viewport => {
|
||||
if (viewport.id !== id) {
|
||||
return viewport;
|
||||
|
Loading…
Reference in New Issue
Block a user