@rails/ujs
Advanced tools
Comparing version 7.1.0 to 7.1.1
@@ -61,2 +61,14 @@ /* | ||
const isContentEditable = function(element) { | ||
var isEditable = false; | ||
do { | ||
if (element.isContentEditable) { | ||
isEditable = true; | ||
break; | ||
} | ||
element = element.parentElement; | ||
} while (element); | ||
return isEditable; | ||
}; | ||
const csrfToken = () => { | ||
@@ -340,2 +352,5 @@ const meta = document.querySelector("meta[name=csrf-token]"); | ||
} | ||
if (isContentEditable(element)) { | ||
return; | ||
} | ||
if (matches(element, linkDisableSelector)) { | ||
@@ -352,2 +367,5 @@ return enableLinkElement(element); | ||
const element = e instanceof Event ? e.target : e; | ||
if (isContentEditable(element)) { | ||
return; | ||
} | ||
if (matches(element, linkDisableSelector)) { | ||
@@ -432,2 +450,5 @@ return disableLinkElement(element); | ||
} | ||
if (isContentEditable(this)) { | ||
return; | ||
} | ||
const href = rails.href(link); | ||
@@ -467,2 +488,6 @@ const csrfToken$1 = csrfToken(); | ||
} | ||
if (isContentEditable(element)) { | ||
fire(element, "ajax:stopped"); | ||
return false; | ||
} | ||
const withCredentials = element.getAttribute("data-with-credentials"); | ||
@@ -673,2 +698,2 @@ const dataType = element.getAttribute("data-type") || "script"; | ||
export default Rails; | ||
export { Rails as default }; |
@@ -47,2 +47,13 @@ /* | ||
const $ = selector => Array.prototype.slice.call(document.querySelectorAll(selector)); | ||
const isContentEditable = function(element) { | ||
var isEditable = false; | ||
do { | ||
if (element.isContentEditable) { | ||
isEditable = true; | ||
break; | ||
} | ||
element = element.parentElement; | ||
} while (element); | ||
return isEditable; | ||
}; | ||
const csrfToken = () => { | ||
@@ -302,2 +313,5 @@ const meta = document.querySelector("meta[name=csrf-token]"); | ||
} | ||
if (isContentEditable(element)) { | ||
return; | ||
} | ||
if (matches(element, linkDisableSelector)) { | ||
@@ -313,2 +327,5 @@ return enableLinkElement(element); | ||
const element = e instanceof Event ? e.target : e; | ||
if (isContentEditable(element)) { | ||
return; | ||
} | ||
if (matches(element, linkDisableSelector)) { | ||
@@ -385,2 +402,5 @@ return disableLinkElement(element); | ||
} | ||
if (isContentEditable(this)) { | ||
return; | ||
} | ||
const href = rails.href(link); | ||
@@ -418,2 +438,6 @@ const csrfToken$1 = csrfToken(); | ||
} | ||
if (isContentEditable(element)) { | ||
fire(element, "ajax:stopped"); | ||
return false; | ||
} | ||
const withCredentials = element.getAttribute("data-with-credentials"); | ||
@@ -420,0 +444,0 @@ const dataType = element.getAttribute("data-type") || "script"; |
{ | ||
"name": "@rails/ujs", | ||
"version": "7.1.0", | ||
"version": "7.1.1", | ||
"description": "Ruby on Rails unobtrusive scripting adapter", | ||
@@ -5,0 +5,0 @@ "main": "app/assets/javascripts/rails-ujs.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48911
1256