File tree Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Expand file tree Collapse file tree 2 files changed +2
-2
lines changed Original file line number Diff line number Diff 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 ]
Original file line number Diff line number Diff 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 ) {
You can’t perform that action at this time.
0 commit comments