Commit 666add76 authored by Ghislain Loas's avatar Ghislain Loas

Merge branch 'dev#71921_amelioration_du_menu_toggle_au_chargement_de_la_page' into 'master'

dev #71921 improve toggle_menu css when loading page

See merge request afi/opacce!2518
parents 044a7324 c478c8ef
- ticket #71921 : Affichage : amélioration du chargement du menu à bascule.
\ No newline at end of file
......@@ -289,7 +289,12 @@ class ZendAfi_View_Helper_Accueil_Base extends ZendAfi_View_Helper_ModuleAbstrac
return $this->_tag('div',
$html,
array_filter(['id' => $this->_getBoxId(),
'class' => 'boite '.strtolower($this->type_module)]));
'class' => $this->_getClasses()]));
}
protected function _getClasses() {
return 'boite ' . strtolower($this->type_module);
}
......
......@@ -116,6 +116,18 @@ class ZendAfi_View_Helper_Accueil_MenuVertical extends ZendAfi_View_Helper_Accue
}
protected function _getClasses() {
$toggle_menu = isset($this->preferences['toggle_menu'])
? $this->preferences['toggle_menu']
: false;
$classes = parent::_getClasses();
return $toggle_menu
? $classes . ' toggle_menu'
: $classes;
}
/**
* @param array $entree
* @return string
......
(function ( $ ) {
$.fn.toggle_menu_slider = function () {
var html = $(this);
html.addClass('toggle_menu');
html.find('h1').bind('click', function(event) {
html.toggleClass('show_menu');
html.find('a').removeAttr('onclick');
......
......@@ -2331,6 +2331,12 @@ class ProfilOptionsControllerWithMenuVerticalWidgetAndNewHtmlTest extends Abstra
}
/** @test */
public function menuWidgetShouldContainsToggleMenuClass() {
$this->assertXPath('//div[@class="boite menu_vertical toggle_menu"]');
}
/** @test */
public function menuWrapperShouldContainsOnly2Menus() {
$this->assertXPathCount('//div[@class="menu_wrapper"]/ul/li', 2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment