mirror of
https://github.com/bigskysoftware/htmx.git
synced 2026-01-25 05:06:13 +00:00
use attributes rather than request count since we are working on a clone of the original DOM
This commit is contained in:
@@ -3060,11 +3060,8 @@ var htmx = (function() {
|
||||
removeClassFromElement(child, className)
|
||||
})
|
||||
// remove the disabled attribute for any element disabled due to an htmx request
|
||||
forEach(findAll(clone, '[disabled]'), function(child) {
|
||||
const internalData = getInternalData(child)
|
||||
if (internalData.requestCount > 0) {
|
||||
forEach(findAll(clone, '[data-disabled-by-htmx]'), function(child) {
|
||||
child.removeAttribute('disabled');
|
||||
}
|
||||
})
|
||||
return clone.innerHTML
|
||||
}
|
||||
@@ -3219,6 +3216,7 @@ var htmx = (function() {
|
||||
const internalData = getInternalData(disabledElement)
|
||||
internalData.requestCount = (internalData.requestCount || 0) + 1
|
||||
disabledElement.setAttribute('disabled', '')
|
||||
disabledElement.setAttribute('data-disabled-by-htmx', '')
|
||||
})
|
||||
return disabledElts
|
||||
}
|
||||
@@ -3240,6 +3238,7 @@ var htmx = (function() {
|
||||
internalData.requestCount = (internalData.requestCount || 0) - 1
|
||||
if (internalData.requestCount === 0) {
|
||||
disabledElement.removeAttribute('disabled')
|
||||
disabledElement.removeAttribute('data-disabled-by-htmx')
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user