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

Optimising If

parent 0a671c82
......@@ -42,8 +42,8 @@ export default {
const lineNumber = Number(location.hash.substr(2));
if (!isNaN(lineNumber)) {
Store.setActiveLine(lineNumber);
if (Store.isPreviewView()) {
if (document.getElementById(`L${lineNumber}`)) document.getElementById(`L${lineNumber}`).scrollIntoView();
if (Store.isPreviewView() && document.getElementById(`L${lineNumber}`)) {
document.getElementById(`L${lineNumber}`).scrollIntoView();
} else {
Helper.monacoInstance.setPosition({
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