You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've added pace-js in asset bundle and registered my own script with paceOptions there.
Added pace-js hooks on concrete links and am controling ajax calls.
{
"require": {
"npm-asset/pace-js": "^1.2",
}
}
class AppAsset extends AssetBundle
{
public $js = [
'js/paceOptions.js',
];
}
class PaceAsset extends AssetBundle
{
public $sourcePath = "@npm/pace-js/";
public $js = [
YII_DEBUG ? 'pace.js' : 'pace.min.js'
];
public $jsOptions = [
'position' => \yii\web\View::POS_END
];
public $depends = [
'app\assets\AppAsset'
];
}
yii2-pace/src/Pace.php
$this->getView()->registerJs('window.paceOptions=' . Json::encode(ArrayHelper::getValue($paceOptions,'options')), \yii\web\View::
POS_BEGIN);
yii2-pace/src/PaceAsset.php
'position' => \yii\web\View::
POS_HEADYou place pace-js library in head and
window.paceOptions={...}
after that in body, so it isn't used.Am I right?
The text was updated successfully, but these errors were encountered: