<?php
/**
 * @author      Olegnax
 * @package     Olegnax_LayeredNavigation
 * @copyright   Copyright (c) 2019 Olegnax (http://olegnax.com/). All rights reserved.
 * @license     Proprietary License https://olegnax.com/license/
 */

use Olegnax\LayeredNavigation\Block\Template;

/** @var Template $block */
?>
<?php $scriptString = <<<script
    requirejs(['jquery', 'OXAjaxNav'],
    function ($) {
        "use strict";

        $(function () {
            $('body').OXAjaxNav({$block->getNavConfig()});
        });
    });
script;
?>
<?php
if (isset($secureRenderer)){
    echo /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false);
} else{
    echo /* @noEscape */ '<script>' .  $scriptString . '</script>';
}
