Merge pull request #23 from dkarvounaris/ivy-patch-missingcss

[-] CSS/JS files not loading when using only "displayNav" without "displayTop"
This commit is contained in:
Jérôme Nadaud
2015-03-16 09:35:04 +01:00
2 changed files with 42 additions and 6 deletions
+10 -6
View File
@@ -66,6 +66,7 @@ class Blocktopmenu extends Module
public function install($delete_params = true)
{
if (!parent::install() ||
!$this->registerHook('header') ||
!$this->registerHook('displayTop') ||
!$this->registerHook('actionObjectCategoryUpdateAfter') ||
!$this->registerHook('actionObjectCategoryDeleteAfter') ||
@@ -713,6 +714,15 @@ class Blocktopmenu extends Module
return parent::getCacheId().'|'.$page_name.($page_name != 'index' ? '|'.(int)Tools::getValue('id_'.$page_name) : '');
}
public function hookHeader()
{
$this->context->controller->addJS($this->_path.'js/hoverIntent.js');
$this->context->controller->addJS($this->_path.'js/superfish-modified.js');
$this->context->controller->addJS($this->_path.'js/blocktopmenu.js');
$this->context->controller->addCSS($this->_path.'css/blocktopmenu.css');
$this->context->controller->addCSS($this->_path.'css/superfish-modified.css');
}
public function hookDisplayTop($param)
{
$this->user_groups = ($this->context->customer->isLogged() ?
@@ -731,12 +741,6 @@ class Blocktopmenu extends Module
$this->smarty->assign('this_path', $this->_path);
}
$this->context->controller->addJS($this->_path.'js/hoverIntent.js');
$this->context->controller->addJS($this->_path.'js/superfish-modified.js');
$this->context->controller->addJS($this->_path.'js/blocktopmenu.js');
$this->context->controller->addCSS($this->_path.'css/blocktopmenu.css');
$this->context->controller->addCSS($this->_path.'css/superfish-modified.css');
$html = $this->display(__FILE__, 'blocktopmenu.tpl', $this->getCacheId());
return $html;
}