summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanang Probo Sayekti2016-01-29 07:08:18 (GMT)
committerDanang Probo Sayekti2016-01-29 07:08:18 (GMT)
commit6c38f459d307513425483db8ea9e815946b5d751 (patch)
treed76f4514104c07e96e2a78cc8e3016bb1dac5edb
parenta227c578e902c5b73348567ec885f1375722c8b9 (diff)
Improve superfish menu.HEAD8.x-1.08.x-1.x
-rw-r--r--css/responsive.css166
-rw-r--r--css/style.css319
-rw-r--r--danland.libraries.yml1
-rw-r--r--danland.theme19
-rw-r--r--js/superfish.js283
-rw-r--r--templates/menu.html.twig2
-rw-r--r--templates/page.html.twig8
7 files changed, 705 insertions, 93 deletions
diff --git a/css/responsive.css b/css/responsive.css
index 4dce4c1..3fd4be0 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 cb933bd..895cdbe 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 7320632..4eb5d05 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 84ec430..1b026a0 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 0000000..8a9c7ca
--- /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 3d1dea7..5f78eca 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 %}
- <ul{{ attributes.addClass('menu') }}>
+ <ul{{ attributes.addClass('menu menu-parent') }}>
{% else %}
<ul class="menu">
{% endif %}
diff --git a/templates/page.html.twig b/templates/page.html.twig
index 7e80343..6005ce7 100644
--- a/templates/page.html.twig
+++ b/templates/page.html.twig
@@ -24,13 +24,11 @@
<div style="clear:both"></div>
<div id="menu">
- <div id="rounded-menu-left"></div>
{% if page.primary_menu %}
<div id="nav">
{{ page.primary_menu }}
</div>
{% endif %}
- <div id="rounded-menu-right"></div>
</div> <!-- end menu -->
<div style="clear:both"></div>
@@ -51,13 +49,13 @@
</div>
{% endif %}
{% if page.slideshow %}
- <div class="slideshow">
+ <div class="custom-slideshow">
{{ page.slideshow }}
</div>
{% else %}
<div class="slideshow">
- {% for key, file in files %}
- <img src="{{ key }}" width="100%" height="100%" alt="slideshow 1"/>
+ {% for file in files %}
+ <img src="{{ file.uri }}" width="100%" height="100%" alt="{{ file.name }}"/>
{% endfor %}
</div>
{% endif %}