From f541f43db1ab2cdef8887aa93ebdfb66f2092669 Mon Sep 17 00:00:00 2001 From: Dan Allen Date: Sat, 11 Apr 2020 03:28:56 -0600 Subject: [PATCH] format source --- gulp.d/tasks/pack.js | 4 +--- gulpfile.js | 6 +++++- src/js/02-on-this-page.js | 6 ++++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/gulp.d/tasks/pack.js b/gulp.d/tasks/pack.js index 46c03f6..a2f1957 100644 --- a/gulp.d/tasks/pack.js +++ b/gulp.d/tasks/pack.js @@ -5,6 +5,4 @@ const zip = require('gulp-vinyl-zip') const path = require('path') module.exports = (src, dest, bundleName) => () => - vfs - .src('**/*', { base: src, cwd: src }) - .pipe(zip.dest(path.join(dest, `${bundleName}-bundle.zip`))) + vfs.src('**/*', { base: src, cwd: src }).pipe(zip.dest(path.join(dest, `${bundleName}-bundle.zip`))) diff --git a/gulpfile.js b/gulpfile.js index a60bd19..adce4c4 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -53,7 +53,11 @@ const formatTask = createTask({ const buildTask = createTask({ name: 'build', desc: 'Build and stage the UI assets for bundling', - call: task.build(srcDir, destDir, process.argv.slice(2).some((name) => name.startsWith('preview'))), + call: task.build( + srcDir, + destDir, + process.argv.slice(2).some((name) => name.startsWith('preview')) + ), }) const bundleBuildTask = createTask({ diff --git a/src/js/02-on-this-page.js b/src/js/02-on-this-page.js index c568555..3946a5a 100644 --- a/src/js/02-on-this-page.js +++ b/src/js/02-on-this-page.js @@ -60,8 +60,10 @@ var lastIdx = headings.length - 1 headings.forEach(function (heading, idx) { var fragment = '#' + heading.id - if (idx === lastIdx || - heading.getBoundingClientRect().top + getStyleValueAsInt(heading, 'paddingTop') > targetPosition) { + if ( + idx === lastIdx || + heading.getBoundingClientRect().top + getStyleValueAsInt(heading, 'paddingTop') > targetPosition + ) { activeFragments.push(fragment) if (lastActiveFragment.indexOf(fragment) < 0) links[fragment].classList.add('is-active') } else if (~lastActiveFragment.indexOf(fragment)) { -- 2.11.0