From baf4f054d2a6a7f5066b728cbd0f47eb5f4801e1 Mon Sep 17 00:00:00 2001 From: Martino Date: Sat, 10 Jun 2023 12:07:14 +0200 Subject: [PATCH] Version 2.0.1 - Simplemenu will now not stop of no menu is present at all (manual or via options) --- CHANGELOG.md | 4 ++++ demo.html | 2 +- package.json | 4 ++-- plugin/simplemenu/plugin-src.js | 3 ++- plugin/simplemenu/simplemenu.esm.js | 6 ++++-- plugin/simplemenu/simplemenu.js | 6 ++++-- 6 files changed, 17 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 629a36d..5406ad1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## [2.0.1] - 2023-06-10 +### Changed +- Simplemenu will now not stop of no menu is present at all (manual or via options) + ## [2.0.0] - 2022-12-22 ### Added diff --git a/demo.html b/demo.html index 38d00d3..09549a0 100644 --- a/demo.html +++ b/demo.html @@ -66,7 +66,7 @@

JavaScript

Reveal.initialize({ plugins: [ Simplemenu ] }); -<script> +</script>

HTML Markup

diff --git a/package.json b/package.json index 5338fe7..4db73d3 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "reveal.js-simplemenu", - "version": "2.0.0", + "version": "2.0.1", "main": "plugin/simplemenu/simplemenu.js", "module": "plugin/simplemenu/simplemenu.esm.js", - "description": "A simple menu for Reveal.js", + "description": "A simple Reveal.js plugin for a menubar or a header or footer with an auto-generated menu.", "keywords": "reveal, reveal.js, reveal-plugin, plugin, menu, header, logo, portfolio", "homepage": "https://github.com/Martinomagnifico/reveal.js-simplemenu", "repository": { diff --git a/plugin/simplemenu/plugin-src.js b/plugin/simplemenu/plugin-src.js index 146543d..8f28597 100644 --- a/plugin/simplemenu/plugin-src.js +++ b/plugin/simplemenu/plugin-src.js @@ -303,8 +303,9 @@ const Plugin = () => { let menus = menuArray(); - if (!menus) { + if (!menus || (menus && !menus.automenus)) { console.log("There are no menus. Please add one or more menus manually or through the 'barhtml' option.") + return } if (menus.automenus.length >= 1 && (sections.namedvisible).length >= 1) { diff --git a/plugin/simplemenu/simplemenu.esm.js b/plugin/simplemenu/simplemenu.esm.js index b5572c5..42f354c 100644 --- a/plugin/simplemenu/simplemenu.esm.js +++ b/plugin/simplemenu/simplemenu.esm.js @@ -4,7 +4,7 @@ * https://github.com/Martinomagnifico * * Simplemenu.js for Reveal.js - * Version 2.0.0 + * Version 2.0.1 * * @license * MIT licensed @@ -14,6 +14,7 @@ ******************************************************************/ + const Plugin = () => { let options = {}; const vars = {}; @@ -356,8 +357,9 @@ const Plugin = () => { debugLog("Preparing menus"); let menus = menuArray(); - if (!menus) { + if (!menus || menus && !menus.automenus) { console.log("There are no menus. Please add one or more menus manually or through the 'barhtml' option."); + return; } if (menus.automenus.length >= 1 && sections.namedvisible.length >= 1) { diff --git a/plugin/simplemenu/simplemenu.js b/plugin/simplemenu/simplemenu.js index a127734..308108b 100644 --- a/plugin/simplemenu/simplemenu.js +++ b/plugin/simplemenu/simplemenu.js @@ -4,7 +4,7 @@ * https://github.com/Martinomagnifico * * Simplemenu.js for Reveal.js - * Version 2.0.0 + * Version 2.0.1 * * @license * MIT licensed @@ -14,6 +14,7 @@ ******************************************************************/ + (function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() : typeof define === 'function' && define.amd ? define(factory) : @@ -362,8 +363,9 @@ debugLog("Preparing menus"); let menus = menuArray(); - if (!menus) { + if (!menus || menus && !menus.automenus) { console.log("There are no menus. Please add one or more menus manually or through the 'barhtml' option."); + return; } if (menus.automenus.length >= 1 && sections.namedvisible.length >= 1) {