mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-14 01:24:19 +02:00
Use String.startsWith
This commit is contained in:
@@ -235,7 +235,7 @@ const EventHandler = {
|
|||||||
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)
|
const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)
|
||||||
const inNamespace = typeEvent !== originalTypeEvent
|
const inNamespace = typeEvent !== originalTypeEvent
|
||||||
const events = getEvent(element)
|
const events = getEvent(element)
|
||||||
const isNamespace = originalTypeEvent.charAt(0) === '.'
|
const isNamespace = originalTypeEvent.startsWith('.')
|
||||||
|
|
||||||
if (typeof originalHandler !== 'undefined') {
|
if (typeof originalHandler !== 'undefined') {
|
||||||
// Simplest case: handler is passed, remove that listener ONLY.
|
// Simplest case: handler is passed, remove that listener ONLY.
|
||||||
|
@@ -45,7 +45,7 @@
|
|||||||
var currentUrl = getOrigin()
|
var currentUrl = getOrigin()
|
||||||
var liveUrl = 'https://v5.getbootstrap.com/'
|
var liveUrl = 'https://v5.getbootstrap.com/'
|
||||||
|
|
||||||
hit.url = currentUrl.lastIndexOf(liveUrl, 0) === 0 ?
|
hit.url = currentUrl.startsWith(liveUrl) ?
|
||||||
// On production, return the result as is
|
// On production, return the result as is
|
||||||
hit.url :
|
hit.url :
|
||||||
// On development or Netlify, replace `hit.url` with a trailing slash,
|
// On development or Netlify, replace `hit.url` with a trailing slash,
|
||||||
|
Reference in New Issue
Block a user