Skip to content

Commit 029be84

Browse files
committed
added .camelCase(), .... twice
SQUASHED: AUTO-COMMIT-src-client-html.js,AUTO-COMMIT-src-components-widgets-lively-morph.js,
1 parent 7ce05c9 commit 029be84

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/client/html.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default class HTML {
141141
// Just an experiment for having to write less code.... which ended up in having more code here ;-) #Jens
142142
Array.prototype.forEach.call(parent.shadowRoot.querySelectorAll("button"), node => {
143143
var name = node.id
144-
var funcName = name.replace(/^./, c => "on"+ c.toUpperCase())
144+
var funcName = name.camelCase().replace(/^./, c => "on"+ c.toUpperCase())
145145
// console.log("register button " + name)
146146
node.addEventListener("click", () => {
147147
var func = parent[funcName]

src/components/widgets/lively-morph.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export default class Morph extends HTMLElement {
7373
// Just an experiment for having to write less code.... which ended up in having more code here ;-) #Jens
7474
Array.from(this.shadowRoot.querySelectorAll('button')).forEach(node => {
7575
var name = node.id;
76-
var funcName = name.replace(/^./, c => 'on'+ c.toUpperCase());
76+
var funcName = name.camelCase().replace(/^./, c => 'on'+ c.toUpperCase());
7777
// console.log('register button ' + name)
7878
node.addEventListener("click", evt => {
7979
if (this[funcName] instanceof Function) {

0 commit comments

Comments
 (0)