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

Merge branch 'dev'

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