Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
connectedCallback() {
super.connectedCallback();
autorun(reaction => {
this.editMode = toJS(store.editMode);
this.__disposer.push(reaction);
});
autorun(reaction => {
this.manifest = toJS(store.manifest);
this.__disposer.push(reaction);
});
afterNextRender(this, function() {
// minor timing thing to ensure store has picked active
// needed if routes set on first paint or lifecycles miss
setTimeout(() => {
autorun(reaction => {
this.activeId = toJS(store.activeId);
this.__disposer.push(reaction);
});
}, 250);
});
}
disconnectedCallback() {
connectedCallback() {
super.connectedCallback();
afterNextRender(this, function() {
this.shadowRoot
.querySelector("#audio")
.addEventListener("loadedmetadata", this._onCanPlay.bind(this));
this.shadowRoot
.querySelector("#audio")
.addEventListener("playing", this._onPlaying.bind(this));
this.shadowRoot
.querySelector("#audio")
.addEventListener("pause", this._onPause.bind(this));
this.shadowRoot
.querySelector("#audio")
.addEventListener("ended", this._onEnd.bind(this));
this.shadowRoot
.querySelector("#audio")
.addEventListener("error", this._onError.bind(this));
});
constructor() {
super();
import("@lrnwebcomponents/user-action/user-action.js");
import("@polymer/iron-image/iron-image.js");
import("@polymer/paper-slider/paper-slider.js");
afterNextRender(this, function() {
this.HAXWiring = new HAXWiring();
this.HAXWiring.setup(
ImageCompareSlider.haxProperties,
ImageCompareSlider.tag,
this
);
});
}
static get template() {
constructor() {
super();
afterNextRender(this, function() {
this.HAXWiring = new HAXWiring();
this.HAXWiring.setup(SimpleImage.haxProperties, SimpleImage.tag, this);
});
}
static get template() {
_schemaChanged() {
//make sure the content is there first
afterNextRender(this, () => {
let itemLabel = this.schema.items.itemLabel;
if (this.schema && Array.isArray(this.schema.value)) {
this.schema.value.forEach(val => {
this.push("__headings", val[itemLabel]);
});
}
this.shadowRoot.querySelectorAll(".item-fields").forEach(item => {
let index = item.getAttribute("data-index"),
propertyName = `${this.propertyPrefix}${this.propertyName}`,
prefix = `${propertyName}.${index}`,
//path = `${propertyName}.properties.${index}`,
val = this.schema.value[index];
//for each array item, request the fields frrom eco-json-schema-object
this.dispatchEvent(
new CustomEvent("build-fieldset", {
bubbles: false,
ready() {
super.ready();
afterNextRender(this, function() {
const iconSets = new IronMeta({ type: "iconset" });
if (
this.icons.length === 0 &&
typeof iconSets !== typeof undefined &&
iconSets.list &&
iconSets.list.length
) {
var iconList = [];
iconSets.list.forEach(function(item) {
item.getIconNames().forEach(icon => {
iconList.push(icon);
});
});
this.__iconList = iconList;
}
});
constructor() {
super();
import("@lrnwebcomponents/simple-concept-network/lib/simple-concept-network-node.js");
afterNextRender(this, function() {
this.HAXWiring = new HAXWiring();
this.HAXWiring.setup(
SimpleConceptNetwork.haxProperties,
SimpleConceptNetwork.tag,
this
);
});
}
static get template() {
ready() {
super.ready();
afterNextRender(this, function() {
this.addEventListener("mousedown", this.tapEventOn.bind(this));
this.addEventListener("mouseover", this.tapEventOn.bind(this));
this.addEventListener("mouseout", this.tapEventOff.bind(this));
this.$.button.addEventListener(
"focused-changed",
this.focusToggle.bind(this)
);
});
}
connectedCallback() {
_editComment() {
this._setEditing(true);
afterNextRender(this, function() {
this.$$('#inputContainer').focus();
});
}