Skip to content

Commit

Permalink
v1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lcdsantos committed Jan 31, 2018
1 parent 33977f4 commit 3e8862a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "MenuSpy",
"version": "1.0.1",
"version": "1.3.0",
"homepage": "https://github.com/lcdsantos/menuspy",
"authors": [
"Leonardo Santos <leocs.1991@gmail.com>"
Expand Down
8 changes: 4 additions & 4 deletions dist/menuspy.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! MenuSpy v1.2.1 (Nov 15 2017) - http://leocs.me/menuspy/ - Copyright (c) 2017 Leonardo Santos; MIT License */
/*! MenuSpy v1.3.0 (Jan 31 2018) - http://leocs.me/menuspy/ - Copyright (c) 2018 Leonardo Santos; MIT License */
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
typeof define === 'function' && define.amd ? define(factory) :
Expand Down Expand Up @@ -83,7 +83,7 @@ var MenuSpy = function MenuSpy(element, options) {
callback : null
};

this.element = element;
this.element = typeof element === 'string' ? document.querySelector(element) : element;
this.options = utils.extend(defaults, options);

this.assignValues();
Expand Down Expand Up @@ -117,12 +117,12 @@ MenuSpy.prototype.cacheItems = function cacheItems () {
this.scrollItems = this.menuItems.map(function (elm) {
var target = elm.dataset.target ? document.querySelector(elm.dataset.target) : document.getElementById(elm.hash.slice(1));
if (target) {
var offset = utils.offset(target).top;
var offset = Math.floor(utils.offset(target).top);
return { elm: elm, target: target, offset: offset };
}
return false;
});
this.scrollItems = this.scrollItems.filter(Boolean);
this.scrollItems = this.scrollItems.filter(Boolean).sort(function (a, b) { return a.offset - b.offset; });
};

MenuSpy.prototype.tick = function tick () {
Expand Down
4 changes: 2 additions & 2 deletions dist/menuspy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3e8862a

Please sign in to comment.