ziko
Version:
A versatile JavaScript library offering a rich set of Hyperscript Based UI components, advanced mathematical utilities, interactivity ,animations, client side routing and more ...
25 lines (22 loc) • 826 B
JavaScript
import { register_view_event } from '../custom-events-registry/view.js';
const CATEGORY = 'view';
export const ViewListeners = {
onEnterView(callback){
if(!this.exp.events?.[CATEGORY]) register_view_event(this.element);
return this.on(
'enterview', callback,
{ category : CATEGORY, isCustom : true})
},
onExitView(callback){
if(!this.exp.events?.[CATEGORY]) register_view_event(this.element);
return this.on(
'exitview', callback,
{ category : CATEGORY, isCustom : true})
},
onResizeView(callback){
if(!this.exp.events?.[CATEGORY]) register_view_event(this.element);
return this.on(
'resizeview', callback,
{ category : CATEGORY, isCustom : true})
},
}