Skip to content

Commit

Permalink
Issue firefox-devtools#3966: Show small values inside tooltip (firefo…
Browse files Browse the repository at this point in the history
  • Loading branch information
tohmjudson authored and amitzur committed Oct 5, 2017
1 parent 39f3466 commit 6eeebb5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/components/Editor/Preview/Popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,8 @@ export class Popup extends Component {
if (
typeof value == "number" ||
typeof value == "boolean" ||
(typeof value == "string" && value.length < 10) ||
(typeof value == "number" && value.toString().length < 10) ||
value.type == "null" ||
value.type == "undefined" ||
value.class === "Function"
Expand Down
10 changes: 9 additions & 1 deletion src/utils/editor/expression.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,22 @@ export function updatePreview(

const invalidToken =
tokenText === "" || tokenText.match(/[(){}\|&%,.;=<>\+-/\*\s]/);

const invalidTarget =
(target.parentElement &&
!target.parentElement.closest(".CodeMirror-line")) ||
cursorPos.top == 0;

const isUpdating = preview && preview.updating;

const inScope = linesInScope && linesInScope.includes(location.line);

if (invalidTarget || !inScope || isUpdating || invalidToken) {
const invaildType =
target.className === "cm-string" ||
target.className === "cm-number" ||
target.className === "cm-atom";

if (invalidTarget || !inScope || isUpdating || invalidToken || invaildType) {
return;
}

Expand Down

0 comments on commit 6eeebb5

Please sign in to comment.