Skip to content

Commit

Permalink
1. 修復 點擊特效 烟花 無效的Bug
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryc127 committed Nov 5, 2019
1 parent 8cb366b commit da4a8d7
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion source/css/_layout/mobile-sidebar.styl
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@
transform: translateX(-254px)
opacity: 1

// pc界面打開mobile-menus需關閉sidebar
// pc界面打開mobile-menus需關閉sidebar
#sidebar
left: -300px !important

Expand Down
17 changes: 17 additions & 0 deletions source/js/utils.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
function debounce(func, wait, immediate) {
var timeout
return function () {
var context = this
var args = arguments
var later = function () {
timeout = null
if (!immediate) func.apply(context, args)
}
var callNow = immediate && !timeout
clearTimeout(timeout)
timeout = setTimeout(later, wait)
if (callNow) func.apply(context, args)
}
};

function throttle(func, wait, options) {
var timeout, context, args, result;
var previous = 0;
Expand Down Expand Up @@ -81,6 +97,7 @@ function snackbarShow(text, showAction, duration) {
}


window.debounce = debounce

window.throttle = throttle

Expand Down

0 comments on commit da4a8d7

Please sign in to comment.