/**
     * registerScript
     *
     * @param \JDocument $template
     *
     * @return  void
     */
    protected static function registerScript(\JDocument $template)
    {
        parent::registerScript($template);
        static::$asset->addJS('template.js');
        static::$asset->addJS('mobile-detect.min.js');
        static::$asset->addJS('jquery/jquery-ui.min.js');
        static::$asset->internalJS(<<<JS
var md = new MobileDetect(window.navigator.userAgent);
console.log(window.navigator.userAgent);

jQuery(document).ready(function(\$) {
\tif (md.mobile())
\t{
\t\t\$('body').addClass('mobile');
\t}
});
JS
);
        // static::$asset->addJs('libraries/owl.carousel.js');
    }
 /**
  * Class init.
  *
  * @param string     $layoutId
  * @param \JDocument $template
  * @param string     $basePath
  * @param array      $options
  */
 public function __construct($layoutId, \JDocument $template = null, $basePath = null, $options = null)
 {
     $this->tpl = $template ?: Template::getTemplate();
     parent::__construct($layoutId, $basePath, $options);
 }
Example #3
0
 /**
  * countRight
  *
  * @return  int
  */
 public static function countRight()
 {
     $tpl = Template::getTemplate();
     return $tpl->countModules('right') ? $tpl->params->get('right_col_width', 3) : 0;
 }