Download the PHP package mylistryx/yii2-overlay-scrollbars-asset without Composer
On this page you can find all versions of the php package mylistryx/yii2-overlay-scrollbars-asset. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mylistryx/yii2-overlay-scrollbars-asset
More information about mylistryx/yii2-overlay-scrollbars-asset
Files in mylistryx/yii2-overlay-scrollbars-asset
Package yii2-overlay-scrollbars-asset
Short Description Yii2 OverlayScrollbars asset bundle
License MIT
Informations about the package yii2-overlay-scrollbars-asset
OverlayScrollbars asset bundle for Yii 2.0 Framework
Based on https://github.com/KingSora/OverlayScrollbars Version of this package is same as plugin version!
Installation
The preferred way to install this extension is through composer
Either run: composer require mylistryx/yii2-overlay-scrollbars-asset
or add "mylistryx/yii2-overlay-scrollbars-asset": "~2.0.0"
into your composer.json
file.
Then register assets in your view file: OverlayScrollbarsAsset::register($this)
or OverlayScrollbarsCdnAsset::register($this)
to use CDN version.
Add same code in your template:
$JS = <<<JS
const SELECTOR_SIDEBAR_WRAPPER = ".sidebar-wrapper";
const Default = {
scrollbarTheme: "os-theme-light",
scrollbarAutoHide: "leave",
scrollbarClickScroll: true
};
document.addEventListener("DOMContentLoaded", function() {
const sidebarWrapper = document.querySelector(SELECTOR_SIDEBAR_WRAPPER);
if (sidebarWrapper && typeof OverlayScrollbarsGlobal?.OverlayScrollbars !== "undefined") {
OverlayScrollbarsGlobal.OverlayScrollbars(sidebarWrapper, {
scrollbars: {
theme: Default.scrollbarTheme,
autoHide: Default.scrollbarAutoHide,
clickScroll: Default.scrollbarClickScroll
},
});
}
});
JS;
$this->registerJs($JS, View::POS_END);
See package documentation https://github.com/KingSora/OverlayScrollbars for more options.
Dependencies
This package depends on:
"php": ">=8.2"
"yiisoft/yii2": "~2.0.0"
base framework files