Skip to content
Yii2 loading overlay widget
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Yii2 loading overlay widget

Yii2 wrapper for jquery loading overlay javascript widget from jgerigmeyer

Widget page

Installation

The preferred way to install this extension is through composer.

Either run

$ php composer.phar require execut/yii2-loading-overlay "dev-master"

or add

"execut/yii2-loading-overlay": "dev-master"

to the require section of your composer.json file.

Usage

For usage javascript widget inside you javascript code simple register \execut\loadingOverlay\LoadingOverlayAsset on you page.

For javascript usage please, refer to widget documentation page

Example

Copy this code to app view file:

<button class="toggle-loading">Toggle overlay</button>
<div id="target" style="height:300px;width:300px;background:gray"></div>
<?php
$this->registerJs(<<<JS
jQuery(function ($) {
  var target = $('#target');
  $('.toggle-loading').click(function () {
    if (target.hasClass('loading')) {
      target.loadingOverlay('remove');
    } else {
      target.loadingOverlay();
    };
  });
});
JS
);
\execut\loadingOverlay\LoadingOverlayAsset::register($this);

License

yii2-loading-overlay is released under the Apache License Version 2.0. See the bundled LICENSE.md for details.

You can’t perform that action at this time.