MCPcopy Create free account
hub / github.com/TruthHun/BookStack / clickHandler

Function clickHandler

static/bootstrap/js/bootstrap.js:507–523  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

505 // =================
506
507 var clickHandler = function (e) {
508 var href
509 var $this = $(this)
510 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
511 if (!$target.hasClass('carousel')) return
512 var options = $.extend({}, $target.data(), $this.data())
513 var slideIndex = $this.attr('data-slide-to')
514 if (slideIndex) options.interval = false
515
516 Plugin.call($target, options)
517
518 if (slideIndex) {
519 $target.data('bs.carousel').to(slideIndex)
520 }
521
522 e.preventDefault()
523 }
524
525 $(document)
526 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)

Callers

nothing calls this directly

Calls 3

extendMethod · 0.80
$Function · 0.50
hasClassMethod · 0.45

Tested by

no test coverage detected