Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/devcows/hugo-universal-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillermo Guerrero Ibarra <wolf.fox1985@gmail.com>2022-03-19 20:52:26 +0300
committerGitHub <noreply@github.com>2022-03-19 20:52:26 +0300
commitbc3d72ccee6c744b60d35341d12306d9336622d0 (patch)
tree14ab2244877f2acf53217e1924eab5b04a06d993
parentedc377a049a4550eea491b4f6a5122793a381110 (diff)
Menu as mouse over. (#348)1.3.1
-rw-r--r--README.md11
-rw-r--r--exampleSite/config.toml2
-rw-r--r--layouts/partials/nav.html2
-rw-r--r--static/js/front.js7
4 files changed, 20 insertions, 2 deletions
diff --git a/README.md b/README.md
index 6868188..f17baa9 100644
--- a/README.md
+++ b/README.md
@@ -127,7 +127,7 @@ Leave the `googleAnalytics` key empty to disable it.
### Logo
-A logo can be selected, two parameters `logo` and `logo_small` can be defined. By default `logo` is used for medium and big screens and the `logo_small` value will be used when the site is rendered on small screens. Also there is the posibility to disable the logo and render a alternative text.
+A logo can be selected, two parameters `logo` and `logo_small` can be defined. By default `logo` is used for medium and big screens and the `logo_small` value will be used when the site is rendered on small screens. Also there is the possibility to disable the logo and render a alternative text.
```toml
[params]
@@ -345,6 +345,15 @@ The social links on the right side are configured as a top-level menu.
pre = "<i class='fas fa-2x fa-facebook'></i>"
```
+### Menu behavior
+
+The dropdown menu is displayed by default when the user clicks on the menu item. However, you can also use the `dropdown_mouse_over` setting to change this behavior and use the mouse over instead.
+
+```toml
+[params]
+ dropdown_mouse_over = true
+```
+
### Blog post thumbnails
After creating a new post you can define a banner by entering the relative path to the image.
diff --git a/exampleSite/config.toml b/exampleSite/config.toml
index 77849f7..bb31873 100644
--- a/exampleSite/config.toml
+++ b/exampleSite/config.toml
@@ -445,6 +445,8 @@ paginate = 10
# Format dates with Go's time formatting
date_format = "January 2, 2006"
+ dropdown_mouse_over = false
+
disabled_logo = false
logo_text = "Universal"
diff --git a/layouts/partials/nav.html b/layouts/partials/nav.html
index 632a396..aebc1e7 100644
--- a/layouts/partials/nav.html
+++ b/layouts/partials/nav.html
@@ -1,5 +1,5 @@
<header class="navbar-affixed-top" data-spy="affix" data-offset-top="62">
- <div class="navbar navbar-default yamm" role="navigation" id="navbar">
+ <div class="navbar navbar-default yamm {{ if .Site.Params.dropdown_mouse_over }}mouseover{{ end }}" role="navigation" id="navbar">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand home" href="{{ "/" | relLangURL }}">
diff --git a/static/js/front.js b/static/js/front.js
index c9f073a..b520584 100644
--- a/static/js/front.js
+++ b/static/js/front.js
@@ -14,6 +14,7 @@ $(function () {
fullScreenContainer()
productDetailGallery(4000)
menuSliding()
+ menuMouseOver()
productDetailSizes()
utils()
animations()
@@ -153,6 +154,12 @@ function menuSliding () {
})
}
+function menuMouseOver () {
+ $('.mouseover .dropdown').hover(function () {
+ $('.dropdown-toggle', this).trigger('click')
+ })
+}
+
/* animations */
function animations () {
var delayTime = 0