]> git.ipfire.org Git - thirdparty/bootstrap.git/commitdiff
Use `String.startsWith`
authorXhmikosR <xhmikosr@gmail.com>
Sat, 2 May 2020 13:31:51 +0000 (16:31 +0300)
committerXhmikosR <xhmikosr@gmail.com>
Sat, 14 Nov 2020 13:54:50 +0000 (15:54 +0200)
js/src/dom/event-handler.js
site/assets/js/search.js

index 439a3f188123870c7276c7338502e53c3e22896d..ceb6a6e6ee334b52162f61ad4989b6bec3cb6bf4 100644 (file)
@@ -235,7 +235,7 @@ const EventHandler = {
     const [delegation, originalHandler, typeEvent] = normalizeParams(originalTypeEvent, handler, delegationFn)
     const inNamespace = typeEvent !== originalTypeEvent
     const events = getEvent(element)
-    const isNamespace = originalTypeEvent.charAt(0) === '.'
+    const isNamespace = originalTypeEvent.startsWith('.')
 
     if (typeof originalHandler !== 'undefined') {
       // Simplest case: handler is passed, remove that listener ONLY.
index 6569b28d6942563eef9a4bb705be800d1bb248d2..cce2bcd0d1141c4b73919657d49cdf6bfa725ecf 100644 (file)
@@ -45,7 +45,7 @@
         var currentUrl = getOrigin()
         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
           hit.url :
           // On development or Netlify, replace `hit.url` with a trailing slash,