[Rt-commit] rt branch, 4.6/upgrade-superfish, created. rt-4.4.4-577-g10393c8dfc
? sunnavy
sunnavy at bestpractical.com
Fri Jan 10 15:34:53 EST 2020
The branch, 4.6/upgrade-superfish has been created
at 10393c8dfc8179e05830cf2512d47cdb07d5bdb1 (commit)
- Log -----------------------------------------------------------------
commit a5bd93668a3f67df8b195b6ce9e6cee63abc5396
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Dec 31 22:14:12 2019 +0800
Upgrade jquery.supposition.js to 0.3a to be compatible with recent superfish
diff --git a/share/static/js/jquery.supposition.js b/share/static/js/jquery.supposition.js
index 0ce5730274..a2e057102a 100644
--- a/share/static/js/jquery.supposition.js
+++ b/share/static/js/jquery.supposition.js
@@ -1,24 +1,23 @@
-/* This file was modified to look for superfish in $.fn.superfish instead of $.superfish */
-
/*
- * Supposition v0.2 - an optional enhancer for Superfish jQuery menu widget
+ * Supposition v0.3a - an optional enhancer for Superfish jQuery menu widget
*
- * Copyright (c) 2008 Joel Birch - based mostly on work by Jesse Klaasse and credit goes largely to him.
+ * Copyright (c) 2013 Joel Birch - based on work by Jesse Klaasse - credit goes largely to him.
* Special thanks to Karl Swedberg for valuable input.
*
* Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
+ * http://www.opensource.org/licenses/mit-license.php
* http://www.gnu.org/licenses/gpl.html
*/
-(function($){
+;(function($){
$.fn.supposition = function(){
- var $w = $(window), /*do this once instead of every onBeforeShow call*/
+ var $w = $(window),/*do this once instead of every onBeforeShow call*/
+ $topNav,
_offset = function(dir) {
- return window[dir == 'y' ? 'pageYOffset' : 'pageXOffset']
- || document.documentElement && document.documentElement[dir=='y' ? 'scrollTop' : 'scrollLeft']
- || document.body[dir=='y' ? 'scrollTop' : 'scrollLeft'];
+ return window[dir === 'y' ? 'pageYOffset' : 'pageXOffset'] ||
+ document.documentElement && document.documentElement[dir==='y' ? 'scrollTop' : 'scrollLeft'] ||
+ document.body[dir==='y' ? 'scrollTop' : 'scrollLeft'];
},
onInit = function(){
/* I haven't touched this bit - needs work as there are still z-index issues */
@@ -40,7 +39,7 @@
totalRight = $w.width() + _offset('x'),
menuRight = $u.offset().left + menuWidth;
if (menuRight > totalRight) {
- $u.css('margin-left', ($u.parents('ul').length == 1 ? totalRight - menuRight : -(menuWidth + parentWidth)) + 'px');
+ $u.css('margin-left', ($u.parents('ul').length === 1 ? totalRight - menuRight : -(menuWidth + parentWidth)) + 'px');
}
var windowHeight = $w.height(),
@@ -56,15 +55,16 @@
};
return this.each(function() {
- var o = $.fn.superfish.o[this.serial]; /* get this menu's options */
+ var $this = $(this),
+ o = $this.data('sf-options'); /* get this menu's options */
/* if callbacks already set, store them */
var _onInit = o.onInit,
_onBeforeShow = o.onBeforeShow,
_onHide = o.onHide;
- $.extend($.fn.superfish.o[this.serial],{
- onInit : function() {
+ $.extend($this.data('sf-options'),{
+ onInit: function() {
onInit.call(this); /* fire our Supposition callback */
_onInit.call(this); /* fire stored callbacks */
},
@@ -72,7 +72,7 @@
onBeforeShow.call(this); /* fire our Supposition callback */
_onBeforeShow.call(this); /* fire stored callbacks */
},
- onHide : function() {
+ onHide: function() {
onHide.call(this); /* fire our Supposition callback */
_onHide.call(this); /* fire stored callbacks */
}
@@ -80,4 +80,4 @@
});
};
-})(jQuery);
+})(jQuery);
\ No newline at end of file
commit 3294eefb13999a1dbe92dde588595f12776a535d
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Dec 31 22:27:06 2019 +0800
Drop deprecated supersubs.js
Superfish itself supports variable menu width since 1.6.0, so it won't
be necessary any more.
The only thing superfish doesn't cover is max-width feature, which we
don't actually need: we do have ticket subjects shown in menu(under
"Recently Viewed"), which could be really long, but we clip them
ourselves.
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 94876843bc..44d35c9e68 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -125,7 +125,6 @@ sub JSFiles {
autocomplete.js
jquery.event.hover-1.0.js
superfish.js
- supersubs.js
jquery.supposition.js
chosen.jquery.min.js
history-folding.js
diff --git a/share/html/NoAuth/css/elevator-light/AfterMenus b/share/html/NoAuth/css/elevator-light/AfterMenus
index db37a13bd2..bae2c52c2f 100644
--- a/share/html/NoAuth/css/elevator-light/AfterMenus
+++ b/share/html/NoAuth/css/elevator-light/AfterMenus
@@ -47,13 +47,8 @@
%# END BPS TAGGED BLOCK }}}
<script type="text/javascript">
var initMenus = function() {
- jQuery.fn.supersubs.defaults = {
- maxWidth: 30,
- extraWidth: 2
- };
-
- jQuery("#app-nav.toplevel").addClass('sf-menu sf-js-enabled sf-shadow').supersubs().superfish({ speed: 'fast' });
- jQuery("#page-menu.toplevel").addClass('sf-menu sf-js-enabled sf-shadow').supersubs().superfish({ dropShadows: false, speed: 'fast' }).supposition();
+ jQuery("#app-nav.toplevel").addClass('sf-menu sf-js-enabled sf-shadow').superfish({ speed: 'fast' });
+ jQuery("#page-menu.toplevel").addClass('sf-menu sf-js-enabled sf-shadow').superfish({ speed: 'fast' }).supposition();
var originalOffset = jQuery("#page-menu").offset().top;
var floatMenu = function () {
@@ -71,7 +66,7 @@ var initMenus = function() {
};
// If everything is loaded, init NOW. Otherwise, defer to DOM ready.
-if (jQuery.fn.supersubs && jQuery.fn.superfish && jQuery.fn.supposition)
+if (jQuery.fn.superfish && jQuery.fn.supposition)
initMenus();
else
jQuery(initMenus);
diff --git a/share/static/js/supersubs.js b/share/static/js/supersubs.js
deleted file mode 100644
index a6fce65241..0000000000
--- a/share/static/js/supersubs.js
+++ /dev/null
@@ -1,90 +0,0 @@
-
-/*
- * Supersubs v0.2b - jQuery plugin
- * Copyright (c) 2008 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
- *
- *
- * This plugin automatically adjusts submenu widths of suckerfish-style menus to that of
- * their longest list item children. If you use this, please expect bugs and report them
- * to the jQuery Google Group with the word 'Superfish' in the subject line.
- *
- */
-
-;(function($){ // $ will refer to jQuery within this closure
-
- $.fn.supersubs = function(options){
- var opts = $.extend({}, $.fn.supersubs.defaults, options);
- // return original object to support chaining
- return this.each(function() {
- // cache selections
- var $$ = $(this);
- // support metadata
- var o = $.meta ? $.extend({}, opts, $$.data()) : opts;
- // get the font size of menu.
- // .css('fontSize') returns various results cross-browser, so measure an em dash instead
- var fontsize = $('<li id="menu-fontsize">—</li>').css({
- 'padding' : 0,
- 'position' : 'absolute',
- 'top' : '-999em',
- 'width' : 'auto'
- }).appendTo($$).width(); //clientWidth is faster, but was incorrect here
- // remove em dash
- $('#menu-fontsize').remove();
- // cache all ul elements
- $ULs = $$.find('ul');
- // loop through each ul in menu
- $ULs.each(function(i) {
- // cache this ul
- var $ul = $ULs.eq(i);
- // get all (li) children of this ul
- var $LIs = $ul.children();
- // get all anchor grand-children
- var $As = $LIs.children('a');
- // force content to one line and save current float property
- var liFloat = $LIs.css('white-space','nowrap').css('float');
- // remove width restrictions and floats so elements remain vertically stacked
- var emWidth = $ul.add($LIs).add($As).css({
- 'float' : 'none',
- 'width' : 'auto'
- })
- // this ul will now be shrink-wrapped to longest li due to position:absolute
- // so save its width as ems. Clientwidth is 2 times faster than .width() - thanks Dan Switzer
- .end().end()[0].clientWidth / fontsize;
- // add more width to ensure lines don't turn over at certain sizes in various browsers
- emWidth += o.extraWidth;
- // restrict to at least minWidth and at most maxWidth
- if (emWidth > o.maxWidth) { emWidth = o.maxWidth; }
- else if (emWidth < o.minWidth) { emWidth = o.minWidth; }
- emWidth += 'em';
- // set ul to width in ems
- $ul.css('width',emWidth);
- // restore li floats to avoid IE bugs
- // set li width to full width of this ul
- // revert white-space to normal
- $LIs.css({
- 'float' : liFloat,
- 'width' : '100%',
- 'white-space' : 'normal'
- })
- // update offset position of descendant ul to reflect new width of parent
- .each(function(){
- var $childUl = $('>ul',this);
- var offsetDirection = $childUl.css('left')!==undefined ? 'left' : 'right';
- $childUl.css(offsetDirection,emWidth);
- });
- });
-
- });
- };
- // expose defaults
- $.fn.supersubs.defaults = {
- minWidth : 9, // requires em unit.
- maxWidth : 25, // requires em unit.
- extraWidth : 0 // extra width can ensure lines don't sometimes turn over due to slight browser differences in how they round-off values
- };
-
-})(jQuery); // plugin code ends
diff --git a/share/static/js/util.js b/share/static/js/util.js
index 7018745172..37ba752f61 100644
--- a/share/static/js/util.js
+++ b/share/static/js/util.js
@@ -641,7 +641,7 @@ jQuery(function() {
jQuery(this).next('.custom-file-label').html(e.target.files[0].name);
});
- jQuery('#assets-accordion span.collapsed').find('ul.toplevel:not(.sf-menu)').addClass('sf-menu sf-js-enabled sf-shadow').supersubs().superfish({ dropShadows: false, speed: 'fast', delay: 0 }).supposition().find('a').click(function(ev){
+ jQuery('#assets-accordion span.collapsed').find('ul.toplevel:not(.sf-menu)').addClass('sf-menu sf-js-enabled sf-shadow').superfish({ dropShadows: false, speed: 'fast', delay: 0 }).supposition().find('a').click(function(ev){
ev.stopPropagation();
return true;
});
commit fed83e0f04de271d24de31acb7c1318121ee757d
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Dec 31 22:34:54 2019 +0800
Upgrade to superfish 1.7.10
The main issue of old version we found is when menus are re-organized
into "More" on narrow screens, the position of 2nd level submenus under
"More" is not calculated correctly. New version doesn't have this issue.
diff --git a/devel/third-party/README b/devel/third-party/README
index 2379223ac2..6e620778d1 100644
--- a/devel/third-party/README
+++ b/devel/third-party/README
@@ -68,3 +68,8 @@ License: MIT
Description: A set of SVG icons. Icon files are installed via npm, then webpack tree-shakes to generate js for only the icons we use.
Origin: https://github.com/FortAwesome/Font-Awesome/tree/master/js-packages/%40fortawesome
License: Icons: CC BY 4.0, Code: MIT License
+
+* superfish-1.7.10
+Description: an enhanced Suckerfish-style menu jQuery plugin
+Origin: https://github.com/joeldbirch/superfish
+License: MIT and GPL
diff --git a/devel/third-party/superfish.js b/devel/third-party/superfish.js
new file mode 100644
index 0000000000..2503662c36
--- /dev/null
+++ b/devel/third-party/superfish.js
@@ -0,0 +1,278 @@
+/*
+ * jQuery Superfish Menu Plugin - v1.7.10
+ * Copyright (c) 2018 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
+ */
+
+;(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, add) {
+ var classes = c.menuClass,
+ method;
+ if (o.cssArrows) {
+ classes += ' ' + c.menuArrowClass;
+ }
+ method = (add) ? 'addClass' : 'removeClass';
+ $menu[method](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, add) {
+ var method = (add) ? 'addClass' : 'removeClass';
+ $li.children('a')[method](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
+ });
+ },
+ getMenu = function ($el) {
+ return $el.closest('.' + c.menuClass);
+ },
+ getOptions = function ($el) {
+ return getMenu($el).data('sfOptions');
+ },
+ over = function () {
+ var $this = $(this),
+ o = getOptions($this);
+ clearTimeout(o.sfTimer);
+ $this.siblings().superfish('hide').end().superfish('show');
+ },
+ 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)();
+ }
+ }
+ },
+ 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);
+ }
+ },
+ 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'))();
+ }
+ }
+ },
+ 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);
+ };
+
+ 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('sfOptions'),
+ $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) {
+ if (typeof style !== 'undefined') {
+ 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('sfOptions');
+ });
+ },
+ init: function (op) {
+ return this.each(function () {
+ var $this = $(this);
+ if ($this.data('sfOptions')) {
+ return false;
+ }
+ var o = $.extend({}, $.fn.superfish.defaults, op),
+ $hasPopUp = $this.find(o.popUpSelector).parent('li');
+ o.$path = setPathToCurrent($this, o);
+
+ $this.data('sfOptions', o);
+
+ toggleMenuClasses($this, o, true);
+ toggleAnchorClass($hasPopUp, true);
+ 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/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index 44d35c9e68..fd80baa6bc 100644
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -124,7 +124,7 @@ sub JSFiles {
util.js
autocomplete.js
jquery.event.hover-1.0.js
- superfish.js
+ superfish.min.js
jquery.supposition.js
chosen.jquery.min.js
history-folding.js
diff --git a/share/static/css/elevator-light/superfish-navbar.css b/share/static/css/elevator-light/superfish-navbar.css
index 459156ec7d..d888bf9dc9 100644
--- a/share/static/css/elevator-light/superfish-navbar.css
+++ b/share/static/css/elevator-light/superfish-navbar.css
@@ -1,95 +1,82 @@
-
/*** adding the class sf-navbar in addition to sf-menu creates an all-horizontal nav-bar menu ***/
.sf-navbar {
- background: #BDD2FF;
- height: 2em;
- padding-bottom: 2em;
- position: relative;
+ background: #BDD2FF;
+ position: relative;
+ margin-bottom: 5em;
+}
+/* provide background colour for submenu strip */
+/* you should just set the menu's container bg colour rather than use pseudo-elements */
+.sf-navbar:before {
+ content: '';
+ position: absolute;
+ left: 0;
+ z-index: -1;
+ background-color: #BDD2FF;
+ height: 200%;
+ width: 100%;
+}
+.sf-navbar ul {
+ box-shadow: none;
}
.sf-navbar li {
- background: #AABDE6;
- position: static;
-}
-.sf-navbar a {
- border-top: none;
+ background: #AABDE6;
+ position: static;
}
-.sf-navbar li ul {
- width: 44em; /*IE6 soils itself without this*/
+.sf-navbar > li > a,
+.sf-navbar > li > ul > li > a {
+ border: none;
}
-.sf-navbar li li {
- background: #BDD2FF;
- position: relative;
+.sf-navbar > li > ul {
+ min-width: 36em; /* set this to whatever suits your design */
}
-.sf-navbar li li ul {
- width: 13em;
+.sf-navbar ul li {
+ background: #BDD2FF;
+ position: relative;
}
-.sf-navbar li li li {
- width: 100%;
+.sf-navbar ul ul {
+ left: 0;
+ top: 100%;
}
-.sf-navbar ul li {
- width: auto;
- float: left;
+.sf-navbar ul ul li {
+ width: 100%;
}
-.sf-navbar a, .sf-navbar a:visited {
- border: none;
+.sf-navbar > li > ul > li {
+ float: left;
}
.sf-navbar li.current {
- background: #BDD2FF;
+ background: #BDD2FF;
}
.sf-navbar li:hover,
.sf-navbar li.sfHover,
-.sf-navbar li li.current,
-.sf-navbar a:focus, .sf-navbar a:hover, .sf-navbar a:active {
- background: #BDD2FF;
+.sf-navbar ul li.current {
+ background: #BDD2FF;
}
.sf-navbar ul li:hover,
.sf-navbar ul li.sfHover,
-ul.sf-navbar ul li:hover li,
-ul.sf-navbar ul li.sfHover li,
-.sf-navbar ul a:focus, .sf-navbar ul a:hover, .sf-navbar ul a:active {
- background: #D1DFFF;
-}
-ul.sf-navbar li li li:hover,
-ul.sf-navbar li li li.sfHover,
-.sf-navbar li li.current li.current,
-.sf-navbar ul li li a:focus, .sf-navbar ul li li a:hover, .sf-navbar ul li li a:active {
- background: #E6EEFF;
-}
-ul.sf-navbar .current ul,
-ul.sf-navbar ul li:hover ul,
-ul.sf-navbar ul li.sfHover ul {
- left: 0;
- top: 2em; /* match top ul list item height */
-}
-ul.sf-navbar .current ul ul {
- top: -999em;
+.sf-navbar ul ul li {
+ background: #D1DFFF;
}
-
-.sf-navbar li li.current > a {
- font-weight: bold;
+.sf-navbar ul ul li:hover,
+.sf-navbar ul ul li.sfHover,
+.sf-navbar ul ul li.current {
+ background: #E6EEFF;
+}
+.sf-navbar ul li.current > a {
+ font-weight: bold;
}
/*** point all arrows down ***/
-/* point right for anchors in subs */
-.sf-navbar ul .sf-sub-indicator { background-position: -10px -100px; }
-.sf-navbar ul a > .sf-sub-indicator { background-position: 0 -100px; }
-/* apply hovers to modern browsers */
-.sf-navbar ul a:focus > .sf-sub-indicator,
-.sf-navbar ul a:hover > .sf-sub-indicator,
-.sf-navbar ul a:active > .sf-sub-indicator,
-.sf-navbar ul li:hover > a > .sf-sub-indicator,
-.sf-navbar ul li.sfHover > a > .sf-sub-indicator {
- background-position: -10px -100px; /* arrow hovers for modern browsers*/
+.sf-arrows.sf-navbar ul .sf-with-ul:after {
+ margin-top: -3px;
+ margin-right: 0;
+ border-color: transparent;
+ border-top-color: #dFeEFF; /* edit this to suit design (no rgba in IE8) */
+ border-top-color: rgba(255,255,255,.5);
}
-/*** remove shadow on first submenu ***/
-.sf-navbar > li > ul {
- background: transparent;
- padding: 0;
- -moz-border-radius-bottomleft: 0;
- -moz-border-radius-topright: 0;
- -webkit-border-top-right-radius: 0;
- -webkit-border-bottom-left-radius: 0;
- border-top-right-radius: 0;
- border-bottom-left-radius: 0;
+.sf-arrows.sf-navbar ul > li > .sf-with-ul:focus:after,
+.sf-arrows.sf-navbar ul > li:hover > .sf-with-ul:after,
+.sf-arrows.sf-navbar ul > .sfHover > .sf-with-ul:after {
+ border-color: transparent;
+ border-top-color: white;
}
diff --git a/share/static/css/elevator-light/superfish-vertical.css b/share/static/css/elevator-light/superfish-vertical.css
index 8025b7859f..3614abfd99 100644
--- a/share/static/css/elevator-light/superfish-vertical.css
+++ b/share/static/css/elevator-light/superfish-vertical.css
@@ -1,23 +1,37 @@
-/*** adding sf-vertical in addition to sf-menu creates a vertical menu ***/
-.sf-vertical, .sf-vertical li {
- width: 10em;
+/* adding sf-vertical class in addition to sf-menu creates a vertical menu */
+/* eg. <ul class="sf-menu sf-vertical"> ... */
+.sf-vertical {
+ width: 12em;
+ /* If you want the width of the closed menu to expand to its
+ widest top-level menu item (like its "Supersubs" submenus do),
+ replace the width rule above with the following two rules. */
+
+ /*
+ min-width: 12em;
+ *width: 12em;
+ */
+}
+.sf-vertical ul {
+ left: 100%;
+ top: 0;
+}
+.sf-vertical > li {
+ float: none;
}
-/* this lacks ul at the start of the selector, so the styles from the main CSS file override it where needed */
-.sf-vertical li:hover ul,
-.sf-vertical li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
+.sf-vertical li {
+ width: 100%;
}
/*** alter arrow directions ***/
-.sf-vertical .sf-sub-indicator { background-position: -10px 0; } /* IE6 gets solid image only */
-.sf-vertical a > .sf-sub-indicator { background-position: 0 0; } /* use translucent arrow for modern browsers*/
-
-/* hover arrow direction for modern browsers*/
-.sf-vertical a:focus > .sf-sub-indicator,
-.sf-vertical a:hover > .sf-sub-indicator,
-.sf-vertical a:active > .sf-sub-indicator,
-.sf-vertical li:hover > a > .sf-sub-indicator,
-.sf-vertical li.sfHover > a > .sf-sub-indicator {
- background-position: -10px 0; /* arrow hovers for modern browsers*/
-}
\ No newline at end of file
+.sf-vertical.sf-arrows > li > .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-vertical.sf-arrows li > .sf-with-ul:focus:after,
+.sf-vertical.sf-arrows li:hover > .sf-with-ul:after,
+.sf-vertical.sf-arrows .sfHover > .sf-with-ul:after {
+ border-left-color: white;
+}
diff --git a/share/static/css/elevator-light/superfish.css b/share/static/css/elevator-light/superfish.css
index 57ac4bfda6..05918e48ab 100644
--- a/share/static/css/elevator-light/superfish.css
+++ b/share/static/css/elevator-light/superfish.css
@@ -1,138 +1,113 @@
-
/*** ESSENTIAL STYLES ***/
.sf-menu, .sf-menu * {
- margin: 0;
- padding: 0;
- list-style: none;
+ margin: 0;
+ padding: 0;
+ list-style: none;
}
-.sf-menu {
- line-height: 1.0;
+.sf-menu li {
+ position: relative;
}
.sf-menu ul {
- position: absolute;
- top: -999em;
- width: 10em; /* left offset of submenus need to match (see below) */
-}
-.sf-menu ul li {
- width: 100%;
+ position: absolute;
+ display: none;
+ top: 100%;
+ left: 0;
+ z-index: 99;
}
-.sf-menu li:hover {
- visibility: inherit; /* fixes IE7 'sticky bug' */
+.sf-menu > li {
+ float: left;
}
-.sf-menu li {
- float: left;
- position: relative;
+.sf-menu li:hover > ul,
+.sf-menu li.sfHover > ul {
+ display: block;
}
+
.sf-menu a {
- display: block;
- position: relative;
-}
-.sf-menu li:hover ul,
-.sf-menu li.sfHover ul {
- left: 0;
- top: 2em; /* match top ul list item height */
- z-index: 99;
-}
-ul.sf-menu li:hover li ul,
-ul.sf-menu li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li:hover ul,
-ul.sf-menu li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
+ display: block;
+ position: relative;
}
-ul.sf-menu li li:hover li ul,
-ul.sf-menu li li.sfHover li ul {
- top: -999em;
-}
-ul.sf-menu li li li:hover ul,
-ul.sf-menu li li li.sfHover ul {
- left: 10em; /* match ul width */
- top: 0;
+.sf-menu ul ul {
+ top: 0;
+ left: 100%;
}
+
/*** DEMO SKIN ***/
.sf-menu {
- float: left;
- margin-bottom: 1em;
+ float: left;
+ margin-bottom: 1em;
+}
+.sf-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 */
}
.sf-menu a {
- border-left: 1px solid #fff;
- border-top: 1px solid #CFDEFF;
- padding: .75em 1em;
- text-decoration:none;
+ border-left: 1px solid #fff;
+ border-top: 1px solid #dFeEFF; /* fallback colour must use full shorthand */
+ border-top: 1px solid rgba(255,255,255,.5);
+ padding: .75em 1em;
+ text-decoration: none;
+ zoom: 1; /* IE7 */
}
-.sf-menu a, .sf-menu a:visited { /* visited pseudo selector so IE6 applies text colour*/
- color: #13a;
+.sf-menu a {
+ color: #13a;
}
.sf-menu li {
- background: #BDD2FF;
+ background: #BDD2FF;
+ white-space: nowrap; /* no need for Supersubs plugin */
+ *white-space: normal; /* ...unless you support IE7 (let it wrap) */
+ -webkit-transition: background .2s;
+ transition: background .2s;
}
-.sf-menu li li {
- background: #AABDE6;
-}
-.sf-menu li li li {
- background: #9AAEDB;
+.sf-menu ul li {
+ background: #AABDE6;
}
-.sf-menu li:hover, .sf-menu li.sfHover,
-.sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active {
- background: #CFDEFF;
- outline: 0;
+.sf-menu ul ul li {
+ background: #9AAEDB;
}
-
-/*** arrows **/
-.sf-menu a.sf-with-ul {
- padding-right: 2.25em;
- min-width: 1px; /* trigger IE7 hasLayout so spans position accurately */
-}
-.sf-sub-indicator {
- position: absolute;
- display: block;
- right: .75em;
- top: 1.05em; /* IE6 only */
- width: 10px;
- height: 10px;
- text-indent: -999em;
- overflow: hidden;
- background: url(../../../static/css/images/arrows-ffffff.png) no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */
-}
-a > .sf-sub-indicator { /* give all except IE6 the correct values */
- top: .8em;
- background-position: 0 -100px; /* use translucent arrow for modern browsers*/
-}
-/* apply hovers to modern browsers */
-a:focus > .sf-sub-indicator,
-a:hover > .sf-sub-indicator,
-a:active > .sf-sub-indicator,
-li:hover > a > .sf-sub-indicator,
-li.sfHover > a > .sf-sub-indicator {
- background-position: -10px -100px; /* arrow hovers for modern browsers*/
-}
-
-/* point right for anchors in subs */
-.sf-menu ul .sf-sub-indicator { background-position: -10px 0; }
-.sf-menu ul a > .sf-sub-indicator { background-position: 0 0; }
-/* apply hovers to modern browsers */
-.sf-menu ul a:focus > .sf-sub-indicator,
-.sf-menu ul a:hover > .sf-sub-indicator,
-.sf-menu ul a:active > .sf-sub-indicator,
-.sf-menu ul li:hover > a > .sf-sub-indicator,
-.sf-menu ul li.sfHover > a > .sf-sub-indicator {
- background-position: -10px 0; /* arrow hovers for modern browsers*/
+.sf-menu li:hover,
+.sf-menu li.sfHover {
+ background: #CFDEFF;
+ /* only transition out, not in */
+ -webkit-transition: none;
+ transition: none;
}
-/*** shadows for all but IE6 ***/
-.sf-shadow ul {
- background: url(../../../static/css/images/shadow.png) no-repeat bottom right;
- padding: 0 8px 9px 0;
- -moz-border-radius-bottomleft: 17px;
- -moz-border-radius-topright: 17px;
- -webkit-border-top-right-radius: 17px;
- -webkit-border-bottom-left-radius: 17px;
- border-top-right-radius: 17px;
- border-bottom-left-radius: 17px;
-}
-.sf-shadow ul.sf-shadow-off {
- background: transparent;
+/*** 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;
}
diff --git a/share/static/js/superfish.js b/share/static/js/superfish.js
deleted file mode 100644
index 45d2e9a625..0000000000
--- a/share/static/js/superfish.js
+++ /dev/null
@@ -1,126 +0,0 @@
-
-/*
- * Superfish v1.5.1 - jQuery menu widget
- * 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
- *
- */
-
-;(function($){
- $.fn.superfish = function(op){
-
- var sf = $.fn.superfish,
- c = sf.c,
- $arrow = $('<span class="'+c.arrowClass+'"> »</span>'),
- over = function(e){
- var $$ = $(this), menu = getMenu($$);
- clearTimeout(menu.sfTimer);
- $$.showSuperfishUl().siblings().hideSuperfishUl();
- },
- out = function(){
- var $$ = $(this), menu = getMenu($$), o = sf.op;
- clearTimeout(menu.sfTimer);
- menu.sfTimer=setTimeout(function(){
- o.retainPath=($.inArray($$[0],o.$path)>-1);
- $$.hideSuperfishUl();
- if (o.$path.length && $$.parents('li.'+o.hoverClass).length<1){
- o.onIdle.call(this);
- over.call(o.$path);
- }
- },o.delay);
- },
- getMenu = function($child){
- if ($child.hasClass(c.menuClass)){
- $.error('Superfish requires you to update to a version of hoverIntent that supports event-delegation, such as this one: https://github.com/joeldbirch/onHoverIntent');
- }
- var menu = $child.closest('.'+c.menuClass)[0];
- sf.op = sf.o[menu.serial];
- return menu;
- },
- applyHandlers = function($menu){
- var targets = 'li:has(ul)';
- if ($.fn.hoverIntent && !sf.op.disableHI){
- $menu.hoverIntent(over, out, targets);
- } else {
- $menu.on('mouseenter', targets, over);
- $menu.on('mouseleave', targets, out);
- }
- $menu.on('focusin', targets, over);
- $menu.on('focusout', targets, out);
- },
- addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
-
- return this.addClass(c.menuClass).each(function() {
- var s = this.serial = sf.o.length;
- var o = $.extend({},sf.defaults,op);
- var $$ = $(this);
- o.$path = $$.find('li.'+o.pathClass).slice(0,o.pathLevels).each(function(){
- $(this).addClass(o.hoverClass+' '+c.bcClass)
- .filter('li:has(ul)').removeClass(o.pathClass);
- });
- sf.o[s] = sf.op = o;
-
- applyHandlers($$);
-
- $$.find('li:has(ul)').each(function() {
- if (o.autoArrows) {
- addArrow( $('>a:first-child',this) );
- }
- })
- .not('.'+c.bcClass)
- .hideSuperfishUl();
-
- o.onInit.call(this);
-
- });
- };
-
- var sf = $.fn.superfish;
- sf.o = [];
- sf.op = {};
-
- sf.c = {
- bcClass : 'sf-breadcrumb',
- menuClass : 'sf-js-enabled',
- anchorClass : 'sf-with-ul',
- arrowClass : 'sf-sub-indicator'
- };
- sf.defaults = {
- hoverClass : 'sfHover',
- pathClass : 'overideThisToUse',
- pathLevels : 1,
- delay : 800,
- animation : {opacity:'show'},
- speed : 'normal',
- autoArrows : true,
- disableHI : false, // true disables hoverIntent detection
- onInit : function(){}, // callback functions
- onBeforeShow: function(){},
- onShow : function(){},
- onHide : function(){},
- onIdle : function(){}
- };
- $.fn.extend({
- hideSuperfishUl : function(){
- var o = sf.op,
- not = (o.retainPath===true) ? o.$path : '';
- o.retainPath = false;
- var $ul = $('li.'+o.hoverClass,this).add(this).not(not).removeClass(o.hoverClass)
- .find('>ul').hide().css('visibility','hidden');
- o.onHide.call($ul);
- return this;
- },
- showSuperfishUl : function(){
- var o = sf.op,
- $ul = this.addClass(o.hoverClass)
- .find('>ul:hidden').css('visibility','visible');
- o.onBeforeShow.call($ul);
- $ul.animate(o.animation,o.speed,function(){ o.onShow.call($ul); });
- return this;
- }
- });
-
-})(jQuery);
diff --git a/share/static/js/superfish.min.js b/share/static/js/superfish.min.js
new file mode 100644
index 0000000000..89b7d0150f
--- /dev/null
+++ b/share/static/js/superfish.min.js
@@ -0,0 +1,10 @@
+/*
+ * jQuery Superfish Menu Plugin - v1.7.10
+ * Copyright (c) 2018 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
+ */
+
+;!function(a,b){"use strict";var c=function(){var c={bcClass:"sf-breadcrumb",menuClass:"sf-js-enabled",anchorClass:"sf-with-ul",menuArrowClass:"sf-arrows"},d=function(){var b=/^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent);return b&&a("html").css("cursor","pointer").on("click",a.noop),b}(),e=function(){var a=document.documentElement.style;return"behavior"in a&&"fill"in a&&/iemobile/i.test(navigator.userAgent)}(),f=function(){return!!b.PointerEvent}(),g=function(a,b,d){var e,f=c.menuClass;b.cssArrows&&(f+=" "+c.menuArrowClass),e=d?"addClass":"removeClass",a[e](f)},h=function(b,d){return b.find("li."+d.pathClass).slice(0,d.pathLevels).addClass(d.hoverClass+" "+c.bcClass).filter(function(){return a(this).children(d.popUpSelector).hide().show().length}).removeClass(d.pathClass)},i=function(a,b){var d=b?"addClass":"removeClass";a.children("a")[d](c.anchorClass)},j=function(a){var b=a.css("ms-touch-action"),c=a.css("touch-action");c=c||b,c="pan-y"===c?"auto
":"pan-y",a.css({"ms-touch-action":c,"touch-action":c})},k=function(a){return a.closest("."+c.menuClass)},l=function(a){return k(a).data("sfOptions")},m=function(){var b=a(this),c=l(b);clearTimeout(c.sfTimer),b.siblings().superfish("hide").end().superfish("show")},n=function(b){b.retainPath=a.inArray(this[0],b.$path)>-1,this.superfish("hide"),this.parents("."+b.hoverClass).length||(b.onIdle.call(k(this)),b.$path.length&&a.proxy(m,b.$path)())},o=function(){var b=a(this),c=l(b);d?a.proxy(n,b,c)():(clearTimeout(c.sfTimer),c.sfTimer=setTimeout(a.proxy(n,b,c),c.delay))},p=function(b){var c=a(this),d=l(c),e=c.siblings(b.data.popUpSelector);return d.onHandleTouch.call(e)===!1?this:void(e.length>0&&e.is(":hidden")&&(c.one("click.superfish",!1),"MSPointerDown"===b.type||"pointerdown"===b.type?c.trigger("focus"):a.proxy(m,c.parent("li"))()))},q=function(b,c){var g="li:has("+c.popUpSelector+")";a.fn.hoverIntent&&!c.disableHI?b.hoverIntent(m,o,g):b.on("mouseenter.superfish",g,m).on("mouseleave.
superfish",g,o);var h="MSPointerDown.superfish";f&&(h="pointerdown.superfish"),d||(h+=" touchend.superfish"),e&&(h+=" mousedown.superfish"),b.on("focusin.superfish","li",m).on("focusout.superfish","li",o).on(h,"a",c,p)};return{hide:function(b){if(this.length){var c=this,d=l(c);if(!d)return this;var e=d.retainPath===!0?d.$path:"",f=c.find("li."+d.hoverClass).add(this).not(e).removeClass(d.hoverClass).children(d.popUpSelector),g=d.speedOut;if(b&&(f.show(),g=0),d.retainPath=!1,d.onBeforeHide.call(f)===!1)return this;f.stop(!0,!0).animate(d.animationOut,g,function(){var b=a(this);d.onHide.call(b)})}return this},show:function(){var a=l(this);if(!a)return this;var b=this.addClass(a.hoverClass),c=b.children(a.popUpSelector);return a.onBeforeShow.call(c)===!1?this:(c.stop(!0,!0).animate(a.animation,a.speed,function(){a.onShow.call(c)}),this)},destroy:function(){return this.each(function(){var b,d=a(this),e=d.data("sfOptions");return!!e&&(b=d.find(e.popUpSelector).parent("li"),clearTimeout(e
.sfTimer),g(d,e),i(b),j(d),d.off(".superfish").off(".hoverIntent"),b.children(e.popUpSelector).attr("style",function(a,b){if("undefined"!=typeof b)return b.replace(/display[^;]+;?/g,"")}),e.$path.removeClass(e.hoverClass+" "+c.bcClass).addClass(e.pathClass),d.find("."+e.hoverClass).removeClass(e.hoverClass),e.onDestroy.call(d),void d.removeData("sfOptions"))})},init:function(b){return this.each(function(){var d=a(this);if(d.data("sfOptions"))return!1;var e=a.extend({},a.fn.superfish.defaults,b),f=d.find(e.popUpSelector).parent("li");e.$path=h(d,e),d.data("sfOptions",e),g(d,e,!0),i(f,!0),j(d),q(d,e),f.not("."+c.bcClass).superfish("hide",!0),e.onInit.call(this)})}}}();a.fn.superfish=function(b,d){return c[b]?c[b].apply(this,Array.prototype.slice.call(arguments,1)):"object"!=typeof b&&b?a.error("Method "+b+" does not exist on jQuery.fn.superfish"):c.init.apply(this,arguments)},a.fn.superfish.defaults={popUpSelector:"ul,.sf-mega",hoverClass:"sfHover",pathClass:"overrideThisToUse",pathLe
vels:1,delay:800,animation:{opacity:"show"},animationOut:{opacity:"hide"},speed:"normal",speedOut:"fast",cssArrows:!0,disableHI:!1,onInit:a.noop,onBeforeShow:a.noop,onShow:a.noop,onBeforeHide:a.noop,onHide:a.noop,onIdle:a.noop,onDestroy:a.noop,onHandleTouch:a.noop}}(jQuery,window);
\ No newline at end of file
commit 403653e42fa9360ae2dbc2d709401a6cfdda2255
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Dec 31 22:57:07 2019 +0800
Adjust menu css to work with superfish 1.7.10
The goal is the menu should look like the old version, but without
issues(see fed83e0f04) we found.
diff --git a/share/static/css/elevator-light/nav.css b/share/static/css/elevator-light/nav.css
index abf6b798d8..9cf4bf4e54 100644
--- a/share/static/css/elevator-light/nav.css
+++ b/share/static/css/elevator-light/nav.css
@@ -13,11 +13,13 @@ ul.sf-menu li {
.sf-menu {
width: 100%;
margin-bottom: 0;
+ line-height: 1;
}
.sf-menu ul {
background-image: none;
padding: 0;
+ min-width: auto;
}
.sf-menu.sf-shadow ul {
@@ -29,8 +31,10 @@ ul.sf-menu li {
box-shadow: 2px 2px 8px -2px #999;
}
-.sf-menu li:hover {
- background-color: #CFDEFF
+.sf-menu li:hover,
+#main-navigation .sf-menu li:hover,
+#page-navigation .sf-menu li:hover {
+ background-color: #CFDEFF;
}
.sf-menu li,
@@ -47,6 +51,10 @@ ul.sf-menu li {
padding-right: 1rem;
}
+.sf-menu ul a.sf-with-ul {
+ padding-right: 2rem;
+}
+
.sf-menu a.sf-with-ul:after {
content: '';
width: 10px;
@@ -85,7 +93,8 @@ ul.sf-menu li {
border-top: none
}
-#main-navigation li li a {
+#main-navigation li li a,
+#page-navigation li li a {
border-top: 1px solid white
}
@@ -126,11 +135,6 @@ ul.sf-menu li {
background-color: #fff
}
-#page-menu.sf-menu li:hover ul,
-#page-menu.sf-menu li.sfHover ul {
- top: 2.5em
-}
-
/* Pin page menu to top left corner once you scroll past it */
#page-navigation #page-menu.pinned {
@@ -334,7 +338,7 @@ ul.sf-menu li {
padding-bottom: .3em;
}
-#page-menu.sf-menu li {
+#page-menu.sf-menu > li {
float: left;
border-color: #E0E6EC;
border-right-style: solid;
@@ -360,13 +364,14 @@ ul.sf-menu li {
ul.toplevel.sf-menu > li > a.sf-with-ul:after {
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' id='i-chevron-down' viewBox='0 0 12 8' height='100%' width='100%' fill='none' stroke='%2331363E' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'><path d='M1 1 l5 5 5 -5' /></svg>") no-repeat center center;
margin-left: 6px;
+ margin-top: 0;
+ right: 0;
position: relative;
}
ul.toplevel.sf-menu > li > ul > li a.sf-with-ul:after {
background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' id='i-chevron-right' viewBox='0 0 7 12' height='100%' width='100%' fill='none' stroke='%2331363E' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'><path d='M1 1 l5 5 -5 5' /></svg>") no-repeat center center;
position: absolute;
- margin-top: 2px;
right: 5px;
}
commit 10393c8dfc8179e05830cf2512d47cdb07d5bdb1
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Dec 31 23:02:56 2019 +0800
Drop workaround for menu width under "More" on old superfish
It's not necessary any more on superfish 1.7.10
diff --git a/share/html/NoAuth/css/elevator-light/BeforeNav b/share/html/NoAuth/css/elevator-light/BeforeNav
index de88edfe20..b22dea7391 100644
--- a/share/html/NoAuth/css/elevator-light/BeforeNav
+++ b/share/html/NoAuth/css/elevator-light/BeforeNav
@@ -141,14 +141,6 @@ var rebalanceOverflowMenu = function (menuId, overflowId, withLogo) {
};
jQuery(function() {
- // without this width fix, because the overflow menu starts out as
- // display: none, superfish calculates its width to be just 2em
- jQuery('#li-overflow').children('ul').css('width', '12em');
- jQuery('#li-page-overflow').children('ul').css('width', '12em');
-
- rebalanceOverflowMenu('#app-nav', '#li-overflow', true);
- rebalanceOverflowMenu('#page-menu', '#li-page-overflow', false);
-
jQuery(window).resize(function () {
rebalanceOverflowMenu('#app-nav', '#li-overflow', true);
rebalanceOverflowMenu('#page-menu', '#li-page-overflow', false);
-----------------------------------------------------------------------
More information about the rt-commit
mailing list