Commit 8d14a956 authored by Tim Zallmann's avatar Tim Zallmann

Optimising If

parent 0a671c82
...@@ -42,8 +42,8 @@ export default { ...@@ -42,8 +42,8 @@ export default {
const lineNumber = Number(location.hash.substr(2)); const lineNumber = Number(location.hash.substr(2));
if (!isNaN(lineNumber)) { if (!isNaN(lineNumber)) {
Store.setActiveLine(lineNumber); Store.setActiveLine(lineNumber);
if (Store.isPreviewView()) { if (Store.isPreviewView() && document.getElementById(`L${lineNumber}`)) {
if (document.getElementById(`L${lineNumber}`)) document.getElementById(`L${lineNumber}`).scrollIntoView(); document.getElementById(`L${lineNumber}`).scrollIntoView();
} else { } else {
Helper.monacoInstance.setPosition({ Helper.monacoInstance.setPosition({
lineNumber: this.activeLine, lineNumber: this.activeLine,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment