Comparing version 8.0.2 to 8.0.3
{ | ||
"name" : "mmenu.js", | ||
"version" : "8.0.2", | ||
"version" : "8.0.3", | ||
"authors" : "Fred Heusschen <info@frebsite.nl>", | ||
@@ -5,0 +5,0 @@ "license" : "CC-BY-NC-4.0", |
const configs = { | ||
scrollOffset: 0, | ||
updateOffset: 50 | ||
}; | ||
export default configs; |
@@ -17,6 +17,6 @@ import Mmenu from '../../core/oncanvas/mmenu.oncanvas'; | ||
if (section) { | ||
// TODO: animate? | ||
document.documentElement.scrollTop = | ||
section.offsetTop + configs.scrollOffset; | ||
document.body.scrollTop = section.offsetTop + configs.scrollOffset; | ||
section.scrollIntoView({ behavior: 'smooth' }); | ||
// document.documentElement.scrollTop = | ||
// section.offsetTop + configs.scrollOffset; | ||
// document.body.scrollTop = section.offsetTop + configs.scrollOffset; | ||
} | ||
@@ -23,0 +23,0 @@ section = null; |
@@ -21,62 +21,40 @@ /* | ||
const { parallel, series } = require('gulp'); | ||
const js = require('./gulp/js'); | ||
const css = require('./gulp/css'); | ||
const { parallel, series } = require( 'gulp' ); | ||
const js = require( './gulp/js' ); | ||
const css = require( './gulp/css' ); | ||
/* | ||
$ gulp | ||
*/ | ||
exports.default = ( cb ) => { | ||
parallel( | ||
js.all, | ||
css.all | ||
)( cb ); | ||
exports.default = cb => { | ||
parallel(js.all, css.all)(cb); | ||
}; | ||
/* | ||
$ gulp js | ||
*/ | ||
exports.js = ( cb ) => { | ||
js.all( cb ); | ||
exports.js = cb => { | ||
js.all(cb); | ||
}; | ||
/* | ||
$ gulp css | ||
*/ | ||
exports.css = ( cb ) => { | ||
css.all( cb ); | ||
exports.css = cb => { | ||
css.all(cb); | ||
}; | ||
/* | ||
$ gulp custom | ||
*/ | ||
exports.custom = ( cb ) => { | ||
parallel( | ||
js.custom, | ||
css.custom | ||
)( cb ); | ||
exports.custom = cb => { | ||
parallel(js.custom, css.custom)(cb); | ||
}; | ||
/* | ||
$ gulp watch | ||
*/ | ||
exports.watch = ( cb ) => { | ||
parallel( | ||
series( | ||
js.all, | ||
js.watch | ||
), | ||
series( | ||
css.all, | ||
css.watch, | ||
) | ||
)( cb ); | ||
exports.watch = cb => { | ||
parallel(series(js.all, js.watch), series(css.all, css.watch))(cb); | ||
}; |
{ | ||
"name": "mmenu-js", | ||
"version": "8.0.2", | ||
"version": "8.0.3", | ||
"main": "dist/mmenu.js", | ||
@@ -5,0 +5,0 @@ "author": "Fred Heusschen <info@frebsite.nl>", |
@@ -23,3 +23,3 @@ mmenu.js | ||
### Browser support | ||
The mmenu javascript plugin uses ES6, meaning IE11 and earlier are not supported. | ||
The mmenu javascript plugin uses ES6, meaning IE11 and earlier are not supported. | ||
If you need support for IE11, use the legacy (jQuery) version: version 7.3.0. | ||
@@ -26,0 +26,0 @@ |
@@ -1,5 +0,4 @@ | ||
const configs : mmConfigsPagescroll = { | ||
scrollOffset: 0, | ||
updateOffset: 50 | ||
const configs: mmConfigsPagescroll = { | ||
updateOffset: 50 | ||
}; | ||
export default configs; | ||
export default configs; |
/** Options for the pageScroll add-on. */ | ||
interface mmOptionsPagescroll { | ||
/** Whether or not to smoothly scroll to a section on the page after clicking a menu item. */ | ||
scroll?: boolean; | ||
/** Whether or not to smoothly scroll to a section on the page after clicking a menu item. */ | ||
scroll ?: boolean | ||
/** Whether or not to automatically make a menu item appear "selected" when scrolling through the section it is linked to. */ | ||
update ?: boolean | ||
/** Whether or not to automatically make a menu item appear "selected" when scrolling through the section it is linked to. */ | ||
update?: boolean; | ||
} | ||
/** Configuration for the pageScroll add-on. */ | ||
interface mmConfigsPagescroll { | ||
/** Amount of pixels to scroll past the top of a section when scrolling. */ | ||
scrollOffset ?: number | ||
/** Amount of pixels to scroll past the top of a section before its menu item will appear "selected". */ | ||
updateOffset ?: number | ||
/** Amount of pixels to scroll past the top of a section before its menu item will appear "selected". */ | ||
updateOffset?: number; | ||
} |
@@ -22,6 +22,7 @@ import Mmenu from '../../core/oncanvas/mmenu.oncanvas'; | ||
if (section) { | ||
// TODO: animate? | ||
document.documentElement.scrollTop = | ||
section.offsetTop + configs.scrollOffset; | ||
document.body.scrollTop = section.offsetTop + configs.scrollOffset; | ||
section.scrollIntoView({ behavior: 'smooth' }); | ||
// document.documentElement.scrollTop = | ||
// section.offsetTop + configs.scrollOffset; | ||
// document.body.scrollTop = section.offsetTop + configs.scrollOffset; | ||
} | ||
@@ -28,0 +29,0 @@ section = null; |
@@ -156,3 +156,12 @@ /** | ||
} | ||
// conf.pageScroll.scrollOffset is deprecated in favor of using native element.scrollIntoView. | ||
if (typeof this.conf.pageScroll.scrollOffset != 'undefined') { | ||
deprecated( | ||
'The "scrollOffset" option in the "pageScroll" configuration', | ||
null, | ||
'8.0.0' | ||
); | ||
} | ||
}; | ||
})(); |
/*! | ||
* mmenu.js v8.0.2 | ||
* mmenu.js v8.0.3 | ||
* mmenujs.com | ||
@@ -4,0 +4,0 @@ * |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
689053
350
0
12136