You can add this widget to actions & widgets, that do some ajax requests or other continuous javascript operations and use Loading.show() and Loading.hide() for displaying pretty animated loading icon/splashscreen
Don't worry about multiple calls of this widget, it don't write any html excepting registering .js and .css files and in any case it happens once per page.
To customize it's view you can copy assets dir to your_theme_dir/LoginWidget/assets and make it looks differ.
The only sense of moving such simple script to reusable widget is a good code organizing practice and common interface.
Yii framework 1.1+
JQuery
In views/layouts:
$this->widget('ext.widgets.loading.LoadingWidget');
In javascript:
Loading.show(); Loading.hide();
Total 5 comments
I like how this extension is non-obtrusive, portable, and DRY. Thanks, I should try it some day.
Can you please elaborate on how to use this extension. Can't figure it out.
how to use this extension?
Great extension, i use in all my projects!! :D
There isn't any demo page =(.
Leave a comment
Please login to leave your comment.