Merge pull request #21 from rancher/side-nav

Side nav
This commit is contained in:
Denise
2018-04-24 16:40:02 -07:00
committed by GitHub
2 changed files with 8 additions and 9 deletions
+1 -6
View File
@@ -75,7 +75,7 @@ gulp.task('init-watch', () => {
});
$.watch('src/sass/**/*.scss', () => gulp.start('sass'));
$.watch('node_modules/rancher-website-theme/**/*.scss', () => gulp.start('sass'));
$.watch('src/js/**/*.js', () => gulp.start('js-watch'));
$.watch('src/js/**/*.js', () => gulp.start('js'));
$.watch('src/img/**/*', () => gulp.start('img'));
$.watch(['archetypes/**/*', 'data/**/*', 'content/**/*', 'layouts/**/*', 'static/**/*', 'themes/**/*', 'node_modules/rancher-website-theme/**/*', 'config.toml'], () => gulp.start('hugo-dev'));
});
@@ -98,11 +98,6 @@ gulp.task('sass', () => {
.pipe(browserSync.stream());
});
gulp.task('js-watch', ['js'], (cb) => {
browserSync.reload();
cb();
});
const vendors = ['ml-stack-nav', 'lory.js', 'tingle.js', 'moment', 'jquery'];
gulp.task('build:vendor', () => {
+7 -3
View File
@@ -189,14 +189,18 @@ const bootstrapNav = function () {
let target = e.target;
if (!target.href) {
let sub = $(e.currentTarget).find('>ul.tree-nav-sublist');
// stop it from affecting other nodes
e.preventDefault();
e.stopPropagation();
// parent li rather then actual el clicked
$(e.currentTarget).toggleClass('open');
if (sub.length > 0) {
sub.toggleClass('hide');
$(e.target).find('>ul.tree-nav-sublist').toggleClass('hide');
// parent li rather then actual el clicked
$(e.currentTarget).toggleClass('open');
}
}
});