Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// if there is a selected suggestion, we shall create a bubble from that suggestions instead of the entered text
if (this.selectedSuggestion != null) {
let bubble = this.bubbleHandler.createBubbleFromSuggestion(this.selectedSuggestion)
if (bubble) {
this.bubbles.push(bubble)
this.textField.value("")
}
} else {
let bubbles = this.bubbleHandler.createBubblesFromText(value)
if (bubbles.length > 0) {
this.bubbles.push(...bubbles)
this.textField.value("")
}
}
m.redraw()
return false //TODO: explain
}
setTimeout(() => {
this.isSubmitting = false;
m.redraw();
const target = e.target as HTMLFormElement;
const inputs = target.elements;
const values = {};
for (let i = 0; i < inputs.length; i++) {
const input = inputs[i] as HTMLInputElement;
values[input.name] = input.value;
}
alert(JSON.stringify(values));
}, 500);
}
actionSource: () => {
showTaxModal.toggle();
m.redraw();
}
}
const parsedStartTime = parseTime(startTime())
const parsedEndTime = parseTime(endTime())
if (!parsedStartTime || !parsedEndTime || !parsedOldStartTime) {
return
}
const endTotalMinutes = parsedEndTime.hours * 60 + parsedEndTime.minutes
const startTotalMinutes = parsedStartTime.hours * 60 + parsedStartTime.minutes
const diff = Math.abs(endTotalMinutes - parsedOldStartTime.hours * 60 - parsedOldStartTime.minutes)
const newEndTotalMinutes = startTotalMinutes + diff
let newEndHours = Math.floor(newEndTotalMinutes / 60)
if (newEndHours > 23) {
newEndHours = 23
}
const newEndMinutes = newEndTotalMinutes % 60
endTime(timeStringFromParts(newEndHours, newEndMinutes, amPmFormat))
m.redraw()
}
reader.onload = function () {
imageFileToUpload(imageInputElementFile);
var dataURL = reader.result;
reward.uploaded_image(dataURL);
m.redraw();
};
reader.readAsDataURL(imageInputElementFile);
function onSearchResults(searchStr, snap) {
var contents = contentFromSnapshot(snap);
ctrl.results = contents.filter(function(content) {
return fuzzy(searchStr, content.search);
});
return m.redraw();
}
let items = [{name: lang.get("deactivated_label"), value: null}]
items = items.concat(customerInfo.domainInfos.filter(d => !d.certificate).map(d => {
return {name: d.domain, value: d.domain}
}))
let initialValue = (props.whitelabelRegistrationDomains.length
=== 0) ? null : props.whitelabelRegistrationDomains[0].value
this._whitelabelRegistrationDomains = new DropDownSelector("whitelabelRegistrationEmailDomain_label", null, items, stream(initialValue), 250).setSelectionChangedHandler(v => {
props.whitelabelRegistrationDomains.length = 0
if (v) {
let domain = createStringWrapper()
domain.value = v
props.whitelabelRegistrationDomains.push(domain)
}
update(props)
})
m.redraw()
})
})
updateAll();
}
let diagramWidth = actorLinkDiv.width();
actorSVG.attr("width", diagramWidth);
actorWidth = actorSVG.node().getBoundingClientRect().width;
boundaryLeft = Math.floor(actorWidth / 2) - 20; //max x coordinate source nodes can move
boundaryRight = Math.ceil(actorWidth / 2) + 20; //max x coordinate target nodes can move
d3.select("#centerLine").attr("d", function () {
return "M" + diagramWidth / 2 + "," + 0 + "V" + actorHeight;
});
updateAll();
redraw && m.redraw();
}
_showLoginForm(mailAddress: string) {
this.mailAddress.value(mailAddress)
this._isDeleteCredentials = false;
this._showingKnownCredentials = false;
m.redraw()
}
const setIndex = idx => {
const oldIndex = index();
if (oldIndex !== idx) {
index(idx);
m.redraw();
if (attrs.getState) {
const el = contentEl;
const page = getPageEl(el, index());
attrs.getState({
index: idx,
hasNext: hasNext(),
hasPrevious: hasPrevious(),
pageEl: page
});
}
}
};