Browse Source

adding bugfix to handle if id not there

master
Björn 5 years ago
parent
commit
2257cc247f
3 changed files with 7 additions and 3 deletions
  1. +1
    -1
      dist/js/demo-386.js
  2. +1
    -1
      package.json
  3. +5
    -1
      src/TinyOnePage.riot

+ 1
- 1
dist/js/demo-386.js
File diff suppressed because it is too large
View File


+ 1
- 1
package.json View File

@ -1,6 +1,6 @@
{
"name": "tiny-one-page",
"version": "1.0.3",
"version": "1.0.4",
"description": "One Page Menu with RiotJS, part of Tiny-Components",
"scripts": {
"dev": "npm run development",


+ 5
- 1
src/TinyOnePage.riot View File

@ -99,7 +99,11 @@
if (window.location.hash) {
this.$("." + this.state.namespace + "__inner a[href$='" + window.location.hash + "']").click();
} else {
this.addClass(this.$$('.' + this.state.namespace + '__inner a')[0]);
const first = this.$$('.' + this.state.namespace + '__inner a')[0];
if (document.querySelector(first.hash)) {
this.addClass(first);
}
}
// adding for outer click and all a-tags click event to close


Loading…
Cancel
Save