MCPcopy Create free account
hub / github.com/cafebazaar/blacksmith / clickHandler

Function clickHandler

web/static/bower_components/bootstrap/js/carousel.js:208–224  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

206 // =================
207
208 var clickHandler = function (e) {
209 var href
210 var $this = $(this)
211 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) // strip for ie7
212 if (!$target.hasClass('carousel')) return
213 var options = $.extend({}, $target.data(), $this.data())
214 var slideIndex = $this.attr('data-slide-to')
215 if (slideIndex) options.interval = false
216
217 Plugin.call($target, options)
218
219 if (slideIndex) {
220 $target.data('bs.carousel').to(slideIndex)
221 }
222
223 e.preventDefault()
224 }
225
226 $(document)
227 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler)

Callers

nothing calls this directly

Calls 1

$Function · 0.85

Tested by

no test coverage detected