More or less cosmetic

This commit is contained in:
Tony Garnock-Jones 2021-12-11 16:54:21 +01:00
parent 92fa548109
commit 666a3daac3
1 changed files with 89 additions and 88 deletions

View File

@ -76,12 +76,12 @@ export function spawnWindowEventFactory(ds: Ref) {
const facet = Turn.activeFacet;
facet.preventInertCheck();
let handler = function (event: Event) {
let handler = (event: Event) => {
facet.turn(() => {
send message P.WindowEvent(eventType, embed(create ({ data: event })));
});
return dealWithPreventDefault(eventType, event);
}
};
function updateEventListeners(install: boolean) {
if (install) {
@ -116,7 +116,8 @@ function spawnUIFragmentFactory(ds: Ref) {
spawn named 'UIFragmentFactory' {
at ds {
during P.UIFragment($fragmentId0, _, _, _) => spawn named ['UIFragment', fragmentId0] {
during P.UIFragment($fragmentId0, _, _, _) =>
spawn named ['UIFragment', fragmentId0] {
if (!isFragmentId(fragmentId0)) return;
const fragmentId = fragmentId0;
@ -309,7 +310,7 @@ function configureNode(n: ChildNode) {
// Runs post-insertion configuration of nodes.
// TODO: review this design.
selectorMatch(n, '.-syndicate-focus').forEach(
function (n: Element | HTMLTextAreaElement | HTMLInputElement) {
(n: Element | HTMLTextAreaElement | HTMLInputElement) => {
if ('focus' in n && 'setSelectionRange' in n) {
n.focus();
n.setSelectionRange(n.value.length, n.value.length);
@ -573,7 +574,7 @@ function selectorMatch(n: Element | Node, selector: string): Array<Element> {
}
function eventUpdater(eventType: string, handlerClosure: (event: Event) => void, install: boolean) {
return function (n: EventTarget) {
return (n: EventTarget) => {
// addEventListener and removeEventListener are idempotent.
if (install) {
n.addEventListener(eventType, handlerClosure);