mirror of
				https://github.com/Jermolene/TiddlyWiki5
				synced 2025-11-04 09:33:00 +00:00 
			
		
		
		
	Add support for widget event listeners to be specified as functions
This commit is contained in:
		@@ -318,6 +318,11 @@ Widget.prototype.addEventListener = function(type,handler) {
 | 
				
			|||||||
		this.eventListeners[type] = function(event) {
 | 
							this.eventListeners[type] = function(event) {
 | 
				
			||||||
			return self[handler].call(self,event);
 | 
								return self[handler].call(self,event);
 | 
				
			||||||
		};
 | 
							};
 | 
				
			||||||
 | 
						} else { // The handler is a function
 | 
				
			||||||
 | 
							this.eventListeners[type] = function(event) {
 | 
				
			||||||
 | 
								return handler.call(self,event);
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user