diff --git a/css/responsive.css b/css/responsive.css index 4dce4c14311a013ba1cf7f752ab2299a60d8e164..3fd4be0a1be2a948656630bc9d69bad3ea113054 100644 --- a/css/responsive.css +++ b/css/responsive.css @@ -80,6 +80,86 @@ border-right: none; } + #menu { + height: auto; + width:100%; + margin: 0 auto; + border-radius: 0px; + background: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; + } + + #nav { + height: auto; + background:none; + float:left; + padding: 0 10px; + margin-top:1em; + } + + #nav .menu li a { + background: #14345c; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#14345c, #285c91); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#14345c, #285c91); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#14345c, #285c91); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#14345c, #285c91); /* Standard syntax */ + } + + #nav .menu li li a { + background: #3b6999; + } + + #nav .menu li:first-child a:hover { + border-top-left-radius:0px; + border-bottom-left-radius:0px; + } + + #nav .menu li:first-child a.is-active { + border-top-left-radius:0px; + border-bottom-left-radius:0px; + } + + #nav .menu li:first-child li a.is-active { + border-radius: 0px; + } + + #nav .menu li li a.is-active { + border-radius: 0px; + } + + #nav .menu li.active-trail:first-child { + border-top-left-radius:0px; + border-bottom-left-radius:0px; + } + + #nav .menu li.active-trail:first-child li { + border-radius: 0px; + } + + #nav .menu li.active-trail li { + border-radius: 0px; + } + + #nav .menu li.active-trail:first-child a.is-active { + border-top-left-radius:0px; + border-bottom-left-radius:0px; + } + + #nav .menu li.active-trail:first-child li a.is-active { + border-radius: 0px; + } + + #nav .menu li.active-trail li a.is-active { + border-radius: 0px; + } + + #nav .menu li:hover ul, + #nav .menu li.sfHover ul { + top:33px; + } + } @media all and (max-width: 480px) { @@ -128,9 +208,13 @@ #menu { height: auto; - background:none; width:100%; margin: 0 auto; + border-radius: 0px; + background: none; + -webkit-box-shadow: none; + -moz-box-shadow: none; + box-shadow: none; } #nav { @@ -140,51 +224,69 @@ padding: 0 10px; margin-top:1em; } + + #nav .menu-parent { + margin-bottom:0; + } + + #nav .menu li a { + background: #14345c; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#14345c, #285c91); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#14345c, #285c91); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#14345c, #285c91); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#14345c, #285c91); /* Standard syntax */ + } + + #nav .menu li li a { + background: #3b6999; + } - #nav ul.menu li { - float:left; - background:none; - height:auto; - padding:0 1px 0 0; - margin:0; + #nav .menu li:first-child a:hover { + border-top-left-radius:0px; + border-bottom-left-radius:0px; } - #nav .menu li a{ - color:#333; - text-decoration:none; - font-size:12px; - padding:5px; - display:inline-block; - font-weight:bold; - height:25px; - text-transform:normal; + #nav .menu li:first-child a.is-active { + border-top-left-radius:0px; + border-bottom-left-radius:0px; } - #nav ul.menu li a:hover { - background:none; - text-decoration:underline; + #nav .menu li:first-child li a.is-active { + border-radius: 0px; } - #nav ul.menu li.active-trail a { - background:none; - text-decoration:underline; + #nav .menu li li a.is-active { + border-radius: 0px; } - #rounded-menu-left { - display:none; + #nav .menu li.active-trail:first-child { + border-top-left-radius:0px; + border-bottom-left-radius:0px; } - #rounded-menu-right { - display:none; + #nav .menu li.active-trail:first-child li { + border-radius: 0px; } - #nav ul.menu, #nav ul.menu li.leaf { - list-style-image:none; - list-style:none; + #nav .menu li.active-trail li { + border-radius: 0px; } - #nav ul.menu, #nav .block ul.menu, #nav ol { - margin:0; - padding:0; + #nav .menu li.active-trail:first-child a.is-active { + border-top-left-radius:0px; + border-bottom-left-radius:0px; + } + + #nav .menu li.active-trail:first-child li a.is-active { + border-radius: 0px; + } + + #nav .menu li.active-trail li a.is-active { + border-radius: 0px; + } + + #nav .menu li:hover ul, + #nav .menu li.sfHover ul { + top:33px; } } \ No newline at end of file diff --git a/css/style.css b/css/style.css index cb933bd20cdbae5b6af627698d46c782e708c8b4..895cdbe56786ee047074da7e06231dd7e16472c6 100644 --- a/css/style.css +++ b/css/style.css @@ -201,72 +201,317 @@ h1,h2,h3,h4,h5,h6 { -------------------------------------------------------------- */ #menu { - height: 35px; - background:url(../images/menu-bg.png) repeat-x; + height: 34px; + background: #14345c; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#14345c, #285c91); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#14345c, #285c91); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#14345c, #285c91); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#14345c, #285c91); /* Standard syntax */ width:952px; margin: 0 auto; + -webkit-box-shadow: 1px 2px 3px -1px rgba(0,0,0,0.75); + -moz-box-shadow: 1px 2px 3px -1px rgba(0,0,0,0.75); + box-shadow: 1px 2px 3px -1px rgba(0,0,0,0.75); + border-radius: 3px; } #nav { - height: 35px; - background:url(../images/menu-bg.png) repeat-x; + height:34px; float:left; } -#nav ul.menu li { - float:left; - background:url(../images/menu-separator.png) no-repeat right top; - height:35px; - padding:0 1px 0 0; +#nav .contextual-links-region { + float: left; + z-index:6; +} + +#nav h2 { + height: 0; + overflow: hidden; + position: absolute; +} + +#nav .menu, #nav .menu * { margin:0; + padding:0; + list-style:none; } -#nav .menu li a{ +#nav .menu { + line-height:1.0; +} + +#nav .menu ul { + position:absolute; + top:-999em; + width:12em; +} + +#nav .menu ul li { + width:100%; +} + +#nav .menu li:hover { + visibility:inherit; +} + +#nav .menu li { + float:left; + position:relative; +} + +#nav .menu a { + display:block; + position:relative; +} + +#nav .menu li:hover ul, +#nav .menu li.sfHover ul { + left:0; + top:34px; + z-index:99; +} + +#nav ul.menu li:hover li ul, +#nav ul.menu li.sfHover li ul { + top:-999em; +} + +#nav ul.menu li li:hover ul, +#nav ul.menu li li.sfHover ul { + left:12em; + top:0; +} + +#nav ul.menu li li:hover li ul, +#nav ul.menu li li.sfHover li ul { + top:-999em; +} + +#nav ul.menu li li li:hover ul, +#nav ul.menu li li li.sfHover ul { + left:12em; + top:0; +} + +#nav .menu { + float:left; + margin-bottom:1em; +} + +#nav .menu a { + padding:.75em 1em; + text-decoration:none; +} + +#nav .menu a, #nav .menu a:visited { color:#fff; text-decoration:none; font-size:12px; - padding:7px 29px 0 29px; - display:inline-block; font-weight:bold; - height:25px; text-transform:uppercase; + padding-right:30px; + padding-left:30px; + padding-top:12px; } -#nav ul.menu li a:hover { - background:transparent url(../images/menu-hover-bg.png) repeat-x; +#nav .menu li { + border-right: 1px solid #345c8c; } -#nav ul.menu li.active-trail a { - background:transparent url(../images/menu-hover-bg.png) repeat-x; +#nav .menu li:last-child { + border-right:none; } -#rounded-menu-left { - height: 35px; - background:transparent url(../images/menu-left-bg.png) no-repeat; - float:left; - width:1px; - line-height:0; - font-size:0; +#nav .menu li li { + background: #3b6999; + border-right:none; } -#rounded-menu-right { - height: 35px; - background:url(../images/menu-right-bg.png) no-repeat; - float:right; - width:14px; - line-height:0; - font-size:0; +#nav .menu li li li { + background: #3b6999; + top: 0px; } -#nav ul.menu, #nav ul.menu li.leaf { - list-style-image:none; - list-style:none; +#nav .menu li:hover, #nav .menu li.sfHover, +#nav .menu a:focus, #nav .menu a:hover, #nav .menu a:active { + outline:0; } -#nav ul.menu, #nav .block ul.menu, #nav ol { - margin:0; - padding:0; +#nav .menu li:hover, +#nav .menu li.sfHover, +#nav .menu a:focus, +#nav .menu a:hover, +#nav .menu a:active { + z-index:10; +} + +#nav .menu li a:hover { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ +} + +#nav .menu li:first-child a:hover { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ + border-top-left-radius:3px; + border-bottom-left-radius:3px; +} + +#nav .menu li li:first-child a:hover { + background: #3b6999; +} + +#nav .menu li li a:hover { + background: #3b6999; +} + +#nav .menu li a.is-active { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ +} + +#nav .menu li:first-child a.is-active { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ + border-top-left-radius:3px; + border-bottom-left-radius:3px; +} + +#nav .menu li li:first-child a.is-active { + background: #3b6999; + border-radius: 0px; +} + +#nav .menu li li a.is-active { + background: #3b6999; + border-radius: 0px; +} + +#nav .menu li.active-trail { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ +} + +#nav .menu li.active-trail:first-child { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ + border-top-left-radius:3px; + border-bottom-left-radius:3px; +} + +#nav .menu li li.active-trail:first-child { + background: #3b6999; + border-radius: 0px; +} + +#nav .menu li.active-trail li { + background: #3b6999; + border-radius: 0px; +} + +#nav .menu li.active-trail a.is-active { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ +} + +#nav .menu li.active-trail:first-child a.is-active { + background: #142f50; /* For browsers that do not support gradients */ + background: -webkit-linear-gradient(#142f50, #26507d); /* For Safari 5.1 to 6.0 */ + background: -o-linear-gradient(#142f50, #26507d); /* For Opera 11.1 to 12.0 */ + background: -moz-linear-gradient(#142f50, #26507d); /* For Firefox 3.6 to 15 */ + background: linear-gradient(#142f50, #26507d); /* Standard syntax */ + border-top-left-radius:3px; + border-bottom-left-radius:3px; +} + +#nav .menu li li.active-trail:first-child a.is-active { + background: #3b6999; + border-radius: 0px; +} + +#nav .menu li.active-trail li a.is-active { + background: #3b6999; + border-radius: 0px; +} + +#nav .menu li.active-trail li { + background: #3b6999; +} + +#nav .menu li li:hover { + background: #3b6999; +} + +#nav .menu li li li:hover { + background: #3b6999; +} + +#nav .menu ul { + box-shadow: 2px 2px 6px rgba(0,0,0,.2); + min-width: 12em; /* allow long menu items to determine submenu width */ + *width: 12em; /* no auto sub width for IE7, see white-space comment below */ +} + +/*** arrows (for all except IE7) **/ +.sf-arrows .sf-with-ul { + padding-right: 2.5em; + *padding-right: 1em; /* no CSS arrows for IE7 (lack pseudo-elements) */ } +/* styling for both css and generated arrows */ +.sf-arrows .sf-with-ul:after { + content: ''; + position: absolute; + top: 50%; + right: 1em; + margin-top: -3px; + height: 0; + width: 0; + /* order of following 3 rules important for fallbacks to work */ + border: 5px solid transparent; + border-top-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */ + border-top-color: rgba(255,255,255,.5); +} +.sf-arrows > li > .sf-with-ul:focus:after, +.sf-arrows > li:hover > .sf-with-ul:after, +.sf-arrows > .sfHover > .sf-with-ul:after { + border-top-color: white; /* IE8 fallback colour */ +} +/* styling for right-facing arrows */ +.sf-arrows ul .sf-with-ul:after { + margin-top: -5px; + margin-right: -3px; + border-color: transparent; + border-left-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */ + border-left-color: rgba(255,255,255,.5); +} +.sf-arrows ul li > .sf-with-ul:focus:after, +.sf-arrows ul li:hover > .sf-with-ul:after, +.sf-arrows ul .sfHover > .sf-with-ul:after { + border-left-color: white; +} + /* slideshow + Preface top + Slideshow -------------------------------------------------------------- */ diff --git a/danland.libraries.yml b/danland.libraries.yml index 7320632a22872aff9c138fdebc6b3158a610f292..4eb5d05a44fbb2bfa63c7c1e808ad89d98e9a452 100644 --- a/danland.libraries.yml +++ b/danland.libraries.yml @@ -7,5 +7,6 @@ global: #css/local.css: {} js: js/jquery.cycle.lite.js: {} + js/superfish.js: {} dependencies: - core/jquery \ No newline at end of file diff --git a/danland.theme b/danland.theme index 84ec4300fa6db2bff06bdc0223404763becfc1ba..1b026a0a13e331bf67f68f24ce58b5be268c1ef4 100644 --- a/danland.theme +++ b/danland.theme @@ -62,6 +62,7 @@ function danland_preprocess_page(&$variables) { $mask = '/\.(?:jp[e]?g|gif|png)$/i'; $files = file_scan_directory(drupal_get_path('theme', 'danland') . '/images/slideshows', $mask); + ksort($files); $variables['files'] = $files; } @@ -74,22 +75,4 @@ function danland_preprocess_block(&$variables) { $variables['attributes']['class'][] = 'block'; $variables['title_attributes']['class'][] = 'block-title'; -} - -/** - * Implements template_preprocess_menu(). - */ -function danland_preprocess_menu(&$variables, $hook) { - - if ($hook == 'menu') { - $current_path = \Drupal::request()->getRequestUri(); - $items = $variables['items']; - foreach ($items as $key => $item) { - // Set an active-trail class if item path matched with current path - if ($item['url']->toString() == $current_path) { - $item['attributes']->addClass('active-trail'); - } - } - } - } \ No newline at end of file diff --git a/js/superfish.js b/js/superfish.js new file mode 100644 index 0000000000000000000000000000000000000000..8a9c7cae3608c80ed17d940b96e79d23a26bd6e3 --- /dev/null +++ b/js/superfish.js @@ -0,0 +1,283 @@ +/* + * jQuery Superfish Menu Plugin + * Copyright (c) 2013 Joel Birch + * + * Dual licensed under the MIT and GPL licenses: + * http://www.opensource.org/licenses/mit-license.php + * http://www.gnu.org/licenses/gpl.html + */ + + jQuery(document).ready(function($) { + $("#nav ul.menu-parent").superfish({ + delay: 100, + animation: {opacity:'show',height:'show'}, + speed: 'fast', + autoArrows: true, + dropShadows: true + }); + }); + +(function ($, w) { + "use strict"; + + var methods = (function () { + // private properties and methods go here + var c = { + bcClass: 'sf-breadcrumb', + menuClass: 'sf-js-enabled', + anchorClass: 'sf-with-ul', + menuArrowClass: 'sf-arrows' + }, + ios = (function () { + var ios = /^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent); + if (ios) { + // tap anywhere on iOS to unfocus a submenu + $('html').css('cursor', 'pointer').on('click', $.noop); + } + return ios; + })(), + wp7 = (function () { + var style = document.documentElement.style; + return ('behavior' in style && 'fill' in style && /iemobile/i.test(navigator.userAgent)); + })(), + unprefixedPointerEvents = (function () { + return (!!w.PointerEvent); + })(), + toggleMenuClasses = function ($menu, o) { + var classes = c.menuClass; + if (o.cssArrows) { + classes += ' ' + c.menuArrowClass; + } + $menu.toggleClass(classes); + }, + setPathToCurrent = function ($menu, o) { + return $menu.find('li.' + o.pathClass).slice(0, o.pathLevels) + .addClass(o.hoverClass + ' ' + c.bcClass) + .filter(function () { + return ($(this).children(o.popUpSelector).hide().show().length); + }).removeClass(o.pathClass); + }, + toggleAnchorClass = function ($li) { + $li.children('a').toggleClass(c.anchorClass); + }, + toggleTouchAction = function ($menu) { + var msTouchAction = $menu.css('ms-touch-action'); + var touchAction = $menu.css('touch-action'); + touchAction = touchAction || msTouchAction; + touchAction = (touchAction === 'pan-y') ? 'auto' : 'pan-y'; + $menu.css({ + 'ms-touch-action': touchAction, + 'touch-action': touchAction + }); + }, + applyHandlers = function ($menu, o) { + var targets = 'li:has(' + o.popUpSelector + ')'; + if ($.fn.hoverIntent && !o.disableHI) { + $menu.hoverIntent(over, out, targets); + } + else { + $menu + .on('mouseenter.superfish', targets, over) + .on('mouseleave.superfish', targets, out); + } + var touchevent = 'MSPointerDown.superfish'; + if (unprefixedPointerEvents) { + touchevent = 'pointerdown.superfish'; + } + if (!ios) { + touchevent += ' touchend.superfish'; + } + if (wp7) { + touchevent += ' mousedown.superfish'; + } + $menu + .on('focusin.superfish', 'li', over) + .on('focusout.superfish', 'li', out) + .on(touchevent, 'a', o, touchHandler); + }, + touchHandler = function (e) { + var $this = $(this), + o = getOptions($this), + $ul = $this.siblings(e.data.popUpSelector); + + if (o.onHandleTouch.call($ul) === false) { + return this; + } + + if ($ul.length > 0 && $ul.is(':hidden')) { + $this.one('click.superfish', false); + if (e.type === 'MSPointerDown' || e.type === 'pointerdown') { + $this.trigger('focus'); + } else { + $.proxy(over, $this.parent('li'))(); + } + } + }, + over = function () { + var $this = $(this), + o = getOptions($this); + clearTimeout(o.sfTimer); + $this.siblings().superfish('hide').end().superfish('show'); + }, + out = function () { + var $this = $(this), + o = getOptions($this); + if (ios) { + $.proxy(close, $this, o)(); + } + else { + clearTimeout(o.sfTimer); + o.sfTimer = setTimeout($.proxy(close, $this, o), o.delay); + } + }, + close = function (o) { + o.retainPath = ($.inArray(this[0], o.$path) > -1); + this.superfish('hide'); + + if (!this.parents('.' + o.hoverClass).length) { + o.onIdle.call(getMenu(this)); + if (o.$path.length) { + $.proxy(over, o.$path)(); + } + } + }, + getMenu = function ($el) { + return $el.closest('.' + c.menuClass); + }, + getOptions = function ($el) { + return getMenu($el).data('sf-options'); + }; + + return { + // public methods + hide: function (instant) { + if (this.length) { + var $this = this, + o = getOptions($this); + if (!o) { + return this; + } + var not = (o.retainPath === true) ? o.$path : '', + $ul = $this.find('li.' + o.hoverClass).add(this).not(not).removeClass(o.hoverClass).children(o.popUpSelector), + speed = o.speedOut; + + if (instant) { + $ul.show(); + speed = 0; + } + o.retainPath = false; + + if (o.onBeforeHide.call($ul) === false) { + return this; + } + + $ul.stop(true, true).animate(o.animationOut, speed, function () { + var $this = $(this); + o.onHide.call($this); + }); + } + return this; + }, + show: function () { + var o = getOptions(this); + if (!o) { + return this; + } + var $this = this.addClass(o.hoverClass), + $ul = $this.children(o.popUpSelector); + + if (o.onBeforeShow.call($ul) === false) { + return this; + } + + $ul.stop(true, true).animate(o.animation, o.speed, function () { + o.onShow.call($ul); + }); + return this; + }, + destroy: function () { + return this.each(function () { + var $this = $(this), + o = $this.data('sf-options'), + $hasPopUp; + if (!o) { + return false; + } + $hasPopUp = $this.find(o.popUpSelector).parent('li'); + clearTimeout(o.sfTimer); + toggleMenuClasses($this, o); + toggleAnchorClass($hasPopUp); + toggleTouchAction($this); + // remove event handlers + $this.off('.superfish').off('.hoverIntent'); + // clear animation's inline display style + $hasPopUp.children(o.popUpSelector).attr('style', function (i, style) { + return style.replace(/display[^;]+;?/g, ''); + }); + // reset 'current' path classes + o.$path.removeClass(o.hoverClass + ' ' + c.bcClass).addClass(o.pathClass); + $this.find('.' + o.hoverClass).removeClass(o.hoverClass); + o.onDestroy.call($this); + $this.removeData('sf-options'); + }); + }, + init: function (op) { + return this.each(function () { + var $this = $(this); + if ($this.data('sf-options')) { + return false; + } + var o = $.extend({}, $.fn.superfish.defaults, op), + $hasPopUp = $this.find(o.popUpSelector).parent('li'); + o.$path = setPathToCurrent($this, o); + + $this.data('sf-options', o); + + toggleMenuClasses($this, o); + toggleAnchorClass($hasPopUp); + toggleTouchAction($this); + applyHandlers($this, o); + + $hasPopUp.not('.' + c.bcClass).superfish('hide', true); + + o.onInit.call(this); + }); + } + }; + })(); + + $.fn.superfish = function (method, args) { + if (methods[method]) { + return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); + } + else if (typeof method === 'object' || ! method) { + return methods.init.apply(this, arguments); + } + else { + return $.error('Method ' + method + ' does not exist on jQuery.fn.superfish'); + } + }; + + $.fn.superfish.defaults = { + popUpSelector: 'ul,.sf-mega', // within menu context + hoverClass: 'sfHover', + pathClass: 'overrideThisToUse', + pathLevels: 1, + delay: 800, + animation: {opacity: 'show'}, + animationOut: {opacity: 'hide'}, + speed: 'normal', + speedOut: 'fast', + cssArrows: true, + disableHI: false, + onInit: $.noop, + onBeforeShow: $.noop, + onShow: $.noop, + onBeforeHide: $.noop, + onHide: $.noop, + onIdle: $.noop, + onDestroy: $.noop, + onHandleTouch: $.noop + }; + +})(jQuery, window); diff --git a/templates/menu.html.twig b/templates/menu.html.twig index 3d1dea7e94618ac5547f145b5e89f9ea4bc7d70d..5f78ecabec55c3605a952dc024e437590050cc2b 100644 --- a/templates/menu.html.twig +++ b/templates/menu.html.twig @@ -30,7 +30,7 @@ {% import _self as menus %} {% if items %} {% if menu_level == 0 %} - + {% else %}