| 1234567891011121314151617181920212223242526272829303132333435 |
- var _ = require('../util')
- var queue = []
- var queued = false
- /**
- * Push a job into the queue.
- *
- * @param {Function} job
- */
- exports.push = function (job) {
- queue.push(job)
- if (!queued) {
- queued = true
- _.nextTick(flush)
- }
- }
- /**
- * Flush the queue, and do one forced reflow before
- * triggering transitions.
- */
- function flush () {
- // Force layout
- var f = document.documentElement.offsetHeight
- for (var i = 0; i < queue.length; i++) {
- queue[i]()
- }
- queue = []
- queued = false
- // dummy return, so js linters don't complain about
- // unused variable f
- return f
- }
|