Skip to content

paceOptions can't be used because it's placed after pace-js is loaded (and tried to use it during loading) #5

@fredeom

Description

@fredeom

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_HEAD

You place pace-js library in head and window.paceOptions={...} after that in body, so it isn't used.

Am I right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions