summaryrefslogtreecommitdiffstats
path: root/devtools/client/debugger/src/components/PrimaryPanes/Outline.js
diff options
context:
space:
mode:
Diffstat (limited to 'devtools/client/debugger/src/components/PrimaryPanes/Outline.js')
-rw-r--r--devtools/client/debugger/src/components/PrimaryPanes/Outline.js18
1 files changed, 12 insertions, 6 deletions
diff --git a/devtools/client/debugger/src/components/PrimaryPanes/Outline.js b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js
index 79ebf7a38e..d52ed8ff40 100644
--- a/devtools/client/debugger/src/components/PrimaryPanes/Outline.js
+++ b/devtools/client/debugger/src/components/PrimaryPanes/Outline.js
@@ -82,6 +82,7 @@ export class Outline extends Component {
selectedLocation: PropTypes.object.isRequired,
getFunctionSymbols: PropTypes.func.isRequired,
getClassSymbols: PropTypes.func.isRequired,
+ selectedSourceTextContent: PropTypes.object,
canFetchSymbols: PropTypes.bool,
};
}
@@ -94,7 +95,8 @@ export class Outline extends Component {
}
componentDidUpdate(prevProps) {
- const { cursorPosition, selectedLocation, canFetchSymbols } = this.props;
+ const { cursorPosition, selectedSourceTextContent, canFetchSymbols } =
+ this.props;
if (cursorPosition && cursorPosition !== prevProps.cursorPosition) {
this.setFocus(cursorPosition);
}
@@ -106,8 +108,11 @@ export class Outline extends Component {
this.focusedElRef.scrollIntoView({ block: "center" });
}
- // Lets make sure the source text has been loaded and is different
- if (canFetchSymbols && prevProps.selectedLocation !== selectedLocation) {
+ // Lets make sure the source text has been loaded and it is different
+ if (
+ canFetchSymbols &&
+ prevProps.selectedSourceTextContent !== selectedSourceTextContent
+ ) {
this.getClassAndFunctionSymbols();
}
}
@@ -133,8 +138,8 @@ export class Outline extends Component {
}
// Find items that enclose the selected location
- const enclosedItems = [...classes, ...functions].filter(
- ({ name, location }) => containsPosition(location, cursorPosition)
+ const enclosedItems = [...classes, ...functions].filter(({ location }) =>
+ containsPosition(location, cursorPosition)
);
if (!enclosedItems.length) {
@@ -360,7 +365,7 @@ export class Outline extends Component {
div(
null,
React.createElement(OutlineFilter, {
- filter: filter,
+ filter,
updateFilter: this.updateFilter,
}),
this.renderFunctions(functions),
@@ -373,6 +378,7 @@ export class Outline extends Component {
const mapStateToProps = state => {
const selectedSourceTextContent = getSelectedSourceTextContent(state);
return {
+ selectedSourceTextContent,
selectedLocation: getSelectedLocation(state),
canFetchSymbols:
selectedSourceTextContent && isFulfilled(selectedSourceTextContent),