File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 11// helper functions to make all input elements
22import $ from "jquery" ;
33import logging from "../core/logging" ;
4+
45const namespace = "input-change-events" ;
56const log = logging . getLogger ( namespace ) ;
67
78const _ = {
8- setup : function ( $el , pat ) {
9+ setup ( $el , pat ) {
910 if ( ! pat ) {
1011 log . error ( "The name of the calling pattern has to be set." ) ;
1112 return ;
@@ -28,7 +29,7 @@ const _ = {
2829 }
2930 } ,
3031
31- setupInputHandlers : function ( $el ) {
32+ setupInputHandlers ( $el ) {
3233 if ( ! $el . is ( ":input" ) ) {
3334 // We've been given an element that is not a form input. We
3435 // therefore assume that it's a container of form inputs and
@@ -41,7 +42,7 @@ const _ = {
4142 }
4243 } ,
4344
44- registerHandlersForElement : function ( ) {
45+ registerHandlersForElement ( ) {
4546 const $el = $ ( this ) ;
4647 const isNumber = $el . is ( "input[type=number]" ) ;
4748 const isText = $el . is ( "input:text, input[type=search], textarea" ) ;
@@ -73,7 +74,7 @@ const _ = {
7374 } ) ;
7475 } ,
7576
76- remove : function ( $el , pat ) {
77+ remove ( $el , pat ) {
7778 let patterns = $el . data ( namespace ) || [ ] ;
7879 if ( patterns . indexOf ( pat ) === - 1 ) {
7980 log . warn ( "input-change-events were never installed for " + pat ) ;
You can’t perform that action at this time.
0 commit comments