Bug 1398725 - Adds tooltip to offset parent indicator and moves ComputedProperty.js to boxmodel/components directory. r=gl

--HG--
rename : devtools/client/inspector/layout/components/ComputedProperty.js => devtools/client/inspector/boxmodel/components/ComputedProperty.js
This commit is contained in:
Danielle Leblanc-Cyr 2019-03-05 11:49:12 -05:00
Родитель 3f6fb10025
Коммит 9423c6df6d
5 изменённых файлов: 20 добавлений и 3 удалений

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

@ -9,7 +9,7 @@ const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { LocalizationHelper } = require("devtools/shared/l10n"); const { LocalizationHelper } = require("devtools/shared/l10n");
const ComputedProperty = createFactory(require("devtools/client/inspector/layout/components/ComputedProperty")); const ComputedProperty = createFactory(require("devtools/client/inspector/boxmodel/components/ComputedProperty"));
const Types = require("../types"); const Types = require("../types");

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

@ -7,6 +7,7 @@
const { PureComponent } = require("devtools/client/shared/vendor/react"); const { PureComponent } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories"); const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types"); const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const { LocalizationHelper } = require("devtools/shared/l10n");
loader.lazyGetter(this, "Rep", function() { loader.lazyGetter(this, "Rep", function() {
return require("devtools/client/shared/components/reps/reps").REPS.Rep; return require("devtools/client/shared/components/reps/reps").REPS.Rep;
@ -17,6 +18,9 @@ loader.lazyGetter(this, "MODE", function() {
loader.lazyRequireGetter(this, "translateNodeFrontToGrip", "devtools/client/inspector/shared/utils", true); loader.lazyRequireGetter(this, "translateNodeFrontToGrip", "devtools/client/inspector/shared/utils", true);
const BOXMODEL_STRINGS_URI = "devtools/client/locales/boxmodel.properties";
const BOXMODEL_L10N = new LocalizationHelper(BOXMODEL_STRINGS_URI);
class ComputedProperty extends PureComponent { class ComputedProperty extends PureComponent {
static get propTypes() { static get propTypes() {
return { return {
@ -56,7 +60,13 @@ class ComputedProperty extends PureComponent {
return ( return (
dom.div({ className: "reference-element" }, dom.div({ className: "reference-element" },
dom.span({ className: "reference-element-type" }, referenceElementType), dom.span(
{
className: "reference-element-type",
title: BOXMODEL_L10N.getStr("boxmodel.offsetParent.title"),
},
referenceElementType
),
Rep({ Rep({
defaultRep: referenceElement, defaultRep: referenceElement,
mode: MODE.TINY, mode: MODE.TINY,

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

@ -10,4 +10,5 @@ DevToolsModules(
'BoxModelInfo.js', 'BoxModelInfo.js',
'BoxModelMain.js', 'BoxModelMain.js',
'BoxModelProperties.js', 'BoxModelProperties.js',
'ComputedProperty.js',
) )

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

@ -7,6 +7,5 @@
DevToolsModules( DevToolsModules(
'Accordion.css', 'Accordion.css',
'Accordion.js', 'Accordion.js',
'ComputedProperty.js',
'LayoutApp.js', 'LayoutApp.js',
) )

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

@ -29,3 +29,10 @@ boxmodel.propertiesLabel=Box Model Properties
# position property, when position is absolute, relative, sticky. This label tells users # position property, when position is absolute, relative, sticky. This label tells users
# what the DOM node previewed next to it is: an offset parent for the position element. # what the DOM node previewed next to it is: an offset parent for the position element.
boxmodel.offsetParent=offset boxmodel.offsetParent=offset
# LOCALIZATION NOTE: (boxmodel.offsetParent.title) This label is displayed as a
# tooltip that appears when hovering over the offset label, inside the list of properties,
# below the box model, in the layout view. This label tells users
# what the DOM node previewed next to it is: an offset parent for the position element.
boxmodel.offsetParent.title=Offset parent of the selected element