tapspace
Version:
A zoomable user interface lib for web apps
24 lines (19 loc) • 472 B
JavaScript
const Hold = require('../../interaction/Hold')
module.exports = function (options) {
// @Item:holdable(options)
//
// Make the item holdable and emit hold events. See interaction.Hold.
//
// Return
// this, for chaining
//
// False to unbind
if (options === false) {
this.removeInteraction('hold')
return this
}
// Begin hold interaction.
const hold = new Hold(this, this, options)
this.addInteraction('hold', hold)
return this
}