Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_activeChanged: function() {
var contentsequencer = dom(this).parentNode;
// Don't syntax highlight code if lrndesign-contentsequencer requests it.
if (
contentsequencer.localName === "lrndesign-contentsequencer" &&
contentsequencer.noHighlight
) {
return;
}
if (this.active && !this._isHighlighted) {
// Minimize jank by waiting one click to do syntax highlighting.
async.microTask.run(() => {
var blocks = dom(this).querySelectorAll("pre > code");
blocks.forEach(
function(block) {
// TODO: consider pre-escaping markup on server.
dom(block).innerHTML = prettyPrintOne(
encodeHTMLEntities_(block.textContent)
);
block.addEventListener(
"copy",
function() {
this.fire("lrndesign-contentsequencer-snippet-copy", {
snippet: block.textContent
});
}.bind(this)
);
_editTrigger(e) {
// bother checking if they can edit or not first
if (typeof this.comment !== typeof undefined && this.comment.actions.edit) {
async.microTask.run(() => {
// show / hide the edit vs display area
this.$.renderedcomment.hidden = this.editform;
this.$.commenteditor.hidden = !this.editform;
// simple icon toggle
if (this.editform) {
this.$.edit.icon = "save";
this.$.edit.alt = "Save";
this.$.reply.disabled = true;
this.$.editcomment.focus();
this.dispatchEvent(
new CustomEvent("comment-editing", {
bubbles: true,
cancelable: true,
composed: true,
detail: { comment: this.comment }
})
_stateLoaded: function() {
// allow everything render and initialize,
// especially this.steps which runs at the same init level
// as iron-localstorage (on attached).
async.microTask.run(() => {
this._storedStep = this.steps[this.state.stepIndex];
// resume dialog is shown only when all 3 conditions hold:
// 1. user has already visited the contentsequencer in the past
// 2. has made at least 1 step
// 3. user is landed on the first step
if (this.selected === 0 && this.state.stepIndex > 0) {
this.$.resumeDialog.open();
}
});
},
case "low":
this.detailsModeIcon = "icons:apps";
this.detailsModeLabel = "Low";
break;
case "mid":
this.detailsModeIcon = "icons:view-module";
this.detailsModeLabel = "Medium";
break;
case "high":
this.detailsModeIcon = "icons:view-carousel";
this.detailsModeLabel = "High";
break;
}
// fire resize event if iron-list is visible
if (this.selectedView === 0) {
async.microTask.run(() => {
setTimeout(() => {
this.shadowRoot.querySelector("#ironlist").dispatchEvent(
new CustomEvent("iron-resize", {
bubbles: true,
cancelable: true,
composed: true,
detail: true
})
);
window.dispatchEvent(new Event("resize"));
}, 50);
});
}
}
}
/**
setData(x,z) {
const __app = this, isArr = x instanceof Array
if (!isArr) {x = _extends({name: (this.label||this.yLabel||this.xLabel),colorByPoint: this.colorByPoint},x)}
if (x && x.length && x[0].data instanceof Array) {
async.microTask.run(_ => {
while (__app._chart.series.length) {
__app.removeSeries(0,false)
}
x.forEach(d => __app._chart.addSeries(d))
}, __app.__microTaskDelaySetData);
} else {__app._getSeries(z)[isArr?"setData":"update"](x)}
}
addData(x,y,z,drillable) {this.pushData(x,y,z,true,drillable)}
setTimeout(() => {
this.__focusedItem = this.activeItem.previousElementSibling;
for (var k in this.items) {
if (this.items[k].parent == this.items[i].id) {
this.items[k].parent = this.items[i].parent;
}
}
this.activeItem.classList.remove("collapse-to-remove");
this.splice("items", i, 1);
if (this.__focusedItem !== undefined && this.__focusedItem !== null) {
async.microTask.run(() => {
setTimeout(() => {
this.__focusedItem.focus();
}, 50);
});
}
}, 300);
}
ready: function() {
var t;
return (
(t = this),
async.microTask.run(() => {
return setTimeout(function() {
return t._onLoad();
});
})
);
},
_createPopup: function() {
ready: function() {
var t;
return (
(t = this),
async.microTask.run(() => {
return setTimeout(function() {
return t._onLoad();
});
})
);
},
_createPopup: function() {
ready: function() {
var t;
return (
(t = this),
async.microTask.run(() => {
return setTimeout(function() {
return t._onLoad();
});
})
);
},
_createPopup: function() {
setTimeout(() => {
async.microTask.run(this._keepContextVisible());
}, 100);
}