Skip to content
Code-Schnipsel Gruppen Projekte
Commit 68f1f154 erstellt von Michael Danielczok's avatar Michael Danielczok
Dateien durchsuchen

feat: Disable mobile menu option in MegaMenu.

Übergeordneter 4e839206
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -22,6 +22,10 @@ define('package/quiqqer/menu/bin/MegaMenu', [
'$onImport'
],
options: {
enablemobile : true
},
initialize: function (options) {
this.parent(options);
......@@ -114,6 +118,10 @@ define('package/quiqqer/menu/bin/MegaMenu', [
}.bind(this)
});
if (!this.getAttribute('enablemobile')) {
return;
}
var SlideNode = document.getElement('[data-qui="package/quiqqer/menu/bin/SlideOut"]'),
SlideOut = QUI.Controls.getById(SlideNode.get('data-quiid'));
......
......@@ -85,11 +85,14 @@ define('package/quiqqer/menu/bin/SlideOut', [
Elm.setStyle('z-index', 1);
}
// body childrens
var children = document.body.getChildren();
var BodyWrapper = new Element('div').inject(document.body);
children.inject(BodyWrapper);
// body childrens
var children = document.body.getChildren();
var BodyWrapper = new Element('div.slideout-wrapper').inject(document.body);
children.inject(BodyWrapper);
Elm.inject(document.body);
// menu button
......
......@@ -48,6 +48,7 @@
{$append}
</nav>
{if $Mobile}
<div class="hide-on-desktop">
{$prepend}
......@@ -58,4 +59,5 @@
{$append}
{$Mobile->create()}
</div>
\ No newline at end of file
</div>
{/if}
\ No newline at end of file
......@@ -17,25 +17,30 @@ class MegaMenu extends AbstractMenu
/**
* @var SlideOut
*/
protected $Mobile;
protected $Mobile = null;
/**
* @param array $attributes
*/
public function __construct($attributes = array())
{
$this->setAttributes(array(
'showStart' => false,
'Start' => false,
'data-qui' => 'package/quiqqer/menu/bin/MegaMenu',
'display' => 'Standard'
));
$this->setAttributes([
'showStart' => false,
'Start' => false,
'data-qui' => 'package/quiqqer/menu/bin/MegaMenu',
'display' => 'Standard',
'enableMobile' => true
]);
parent::__construct($attributes);
$this->addCSSClass('quiqqer-menu-megaMenu');
$this->addCSSFile(dirname(__FILE__) . '/MegaMenu.css');
if (!$this->getAttribute('enableMobile')) {
return;
}
$this->Mobile = new QUI\Menu\SlideOut();
// defaults
......@@ -60,16 +65,20 @@ public function getBody()
$Engine = QUI::getTemplateManager()->getEngine();
$childControl = $this->getMenuControl($this->getAttribute('display'));
$this->Mobile->setAttribute('Project', $this->getProject());
$this->Mobile->setAttribute('Site', $this->getSite());
if ($this->Mobile) {
$this->Mobile->setAttribute('Project', $this->getProject());
$this->Mobile->setAttribute('Site', $this->getSite());
$this->Mobile->setAttribute('data-menu-right', 10);
$this->Mobile->setAttribute('data-menu-top', 15);
$this->Mobile->setAttribute('data-show-button-on-desktop', 0);
$this->Mobile->setAttribute('data-qui-options-menu-width', 400);
$this->Mobile->setAttribute('data-qui-options-menu-button', 0);
$this->Mobile->setAttribute('data-qui-options-touch', 0);
$this->Mobile->setAttribute('data-qui-options-buttonids', 'mobileMenu');
}
$this->Mobile->setAttribute('data-menu-right', 10);
$this->Mobile->setAttribute('data-menu-top', 15);
$this->Mobile->setAttribute('data-show-button-on-desktop', 0);
$this->Mobile->setAttribute('data-qui-options-menu-width', 400);
$this->Mobile->setAttribute('data-qui-options-menu-button', 0);
$this->Mobile->setAttribute('data-qui-options-touch', 0);
$this->Mobile->setAttribute('data-qui-options-buttonids', 'mobileMenu');
$this->setAttribute('data-qui-options-enablemobile', $this->getAttribute('enableMobile'));
$Engine->assign(array(
'this' => $this,
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren