Skip to content

Commit

Permalink
* core: support to execute js code from attr zui-init.
Browse files Browse the repository at this point in the history
  • Loading branch information
catouse committed Jan 18, 2024
1 parent fb2b012 commit 8988ff9
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/core/src/helpers/zui-creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ $.fn.zuiInit = function (this: Cash) {
}
requestAnimationFrame(() => create(name, this, options));
});
this.find('[zui-init]').each(function () {
const $element = $(this);
$.runJS($element.attr('zui-init') as string, ['$element', $element]);
});
this.find('.hide-before-init').removeClass('invisible hidden opacity-0');
this.find('.scroll-into-view').scrollIntoView();
this.find('[data-on="inited"]').each((_, ele) => {
Expand Down

0 comments on commit 8988ff9

Please sign in to comment.