Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-07-21 10:57:00 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2022-07-21 11:08:24 +0300
commit9446184f84a8a678b6712bd3f49bdb282d1e14e7 (patch)
tree897cdf9da6b322d70dfe6774f52047e1b631e1bc /alpinejs/packages/alpinejs/src/utils/bind.js
parent99f542f0c2fb665466c4e1ec3d11713d086d31cf (diff)
Update to Alpine 3.10.3HEADalpinejs/v3.21000.20300main
Diffstat (limited to 'alpinejs/packages/alpinejs/src/utils/bind.js')
-rw-r--r--alpinejs/packages/alpinejs/src/utils/bind.js12
1 files changed, 6 insertions, 6 deletions
diff --git a/alpinejs/packages/alpinejs/src/utils/bind.js b/alpinejs/packages/alpinejs/src/utils/bind.js
index fc89b20..2c3b2a9 100644
--- a/alpinejs/packages/alpinejs/src/utils/bind.js
+++ b/alpinejs/packages/alpinejs/src/utils/bind.js
@@ -7,7 +7,7 @@ export default function bind(el, name, value, modifiers = []) {
if (! el._x_bindings) el._x_bindings = reactive({})
el._x_bindings[name] = value
-
+
name = modifiers.includes('camel') ? camelCase(name) : name
switch (name) {
@@ -129,21 +129,21 @@ function attributeShouldntBePreservedIfFalsy(name) {
}
export function getBinding(el, name, fallback) {
- // First let's get it out of Alpine bound data.
+ // First let's get it out of Alpine bound data.
if (el._x_bindings && el._x_bindings[name] !== undefined) return el._x_bindings[name]
- // If not, we'll return the literal attribute.
+ // If not, we'll return the literal attribute.
let attr = el.getAttribute(name)
// Nothing bound:
if (attr === null) return typeof fallback === 'function' ? fallback() : fallback
-
+
if (isBooleanAttr(name)) {
return !! [name, 'true'].includes(attr)
}
- // The case of a custom attribute with no value. Ex: <div manual>
+ // The case of a custom attribute with no value. Ex: <div manual>
if (attr === '') return true
-
+
return attr
}