* zin: support to bind multiple events with single callback.

This commit is contained in:
sunhao
2024-01-31 14:01:04 +08:00
parent 68a77356df
commit 648b96c765
+4 -1
View File
@@ -135,7 +135,10 @@ class on extends jsCallback
$selector = $this->selector ? (',' . static::json($this->selector)) : '';
$callback = parent::toJS($joiner);
return "\$element.$bindMethod('{$this->event}.zin.on'$selector,$callback);";
$events = array_map(function($event){return $event . '.zin.on';}, explode('_', $this->event));
$events = implode(' ', $events);
return "\$element.$bindMethod('$events'$selector,$callback);";
}
/**