|
217 | 217 | formData.set(propertyName, el.value); |
218 | 218 | } |
219 | 219 |
|
220 | | - el.setAttribute("hydro-operation-id", binding[component.id].operationId); |
| 220 | + el.setAttribute("data-operation-id", binding[component.id].operationId); |
221 | 221 | el.classList.add('hydro-request'); |
222 | 222 |
|
223 | 223 | if (bindAlreadyInitialized) { |
|
261 | 261 | } |
262 | 262 |
|
263 | 263 | const operationId = generateGuid(); |
264 | | - el.setAttribute("hydro-operation-id", operationId); |
| 264 | + el.setAttribute("data-operation-id", operationId); |
265 | 265 |
|
266 | 266 | await hydroRequest(el, url, { parameters: action.parameters }, 'action', null, operationId, true); |
267 | 267 | } |
|
289 | 289 | if (!operationStatus[operationId]) { |
290 | 290 | operationStatus[operationId] = 0; |
291 | 291 |
|
292 | | - const operationTrigger = document.querySelector(`[hydro-operation-id="${operationId}"]`); |
| 292 | + const operationTrigger = document.querySelector(`[data-operation-id="${operationId}"]`); |
293 | 293 |
|
294 | 294 | if (operationTrigger) { |
295 | 295 | classTimeout = setTimeout(() => operationTrigger.classList.add('hydro-request'), 200); |
|
402 | 402 | } |
403 | 403 | } |
404 | 404 |
|
405 | | - if (from.getAttribute && from.getAttribute("hydro-operation-id")) { |
| 405 | + if (from.getAttribute && from.getAttribute("data-operation-id")) { |
406 | 406 | // skip result from bind operation when this operating element is not a hydro component and is awaiting a request already |
407 | | - if (type === 'bind' && operationId !== from.getAttribute("hydro-operation-id") && from.getAttribute("hydro") === null) { |
| 407 | + if (type === 'bind' && operationId !== from.getAttribute("data-operation-id") && from.getAttribute("hydro") === null) { |
408 | 408 | skip(); |
409 | 409 | counter++; |
410 | 410 | return; |
411 | 411 | } |
412 | 412 |
|
413 | 413 | // set the operation id, disabled state and hydro class that would be lost after morph |
414 | | - to.setAttribute("hydro-operation-id", from.getAttribute("hydro-operation-id")); |
| 414 | + to.setAttribute("data-operation-id", from.getAttribute("data-operation-id")); |
415 | 415 | to.disabled = from.disabled; |
416 | 416 | if (from.classList.contains('hydro-request')) { |
417 | 417 | to.classList.add('hydro-request'); |
|
507 | 507 | clearTimeout(disableTimer); |
508 | 508 |
|
509 | 509 | if (operationId) { |
510 | | - const operationTrigger = document.querySelectorAll(`[hydro-operation-id="${operationId}"]`); |
| 510 | + const operationTrigger = document.querySelectorAll(`[data-operation-id="${operationId}"]`); |
511 | 511 | operationStatus[operationId]--; |
512 | 512 |
|
513 | 513 | if (operationTrigger.length && (operationStatus[operationId] <= 0)) { |
514 | 514 | operationTrigger.forEach(trigger => { |
515 | 515 | trigger.disabled = false; |
516 | 516 | trigger.classList.remove('hydro-request'); |
517 | | - trigger.removeAttribute('hydro-operation-id'); |
| 517 | + trigger.removeAttribute('data-operation-id'); |
518 | 518 | }) |
519 | 519 | } |
520 | 520 | } |
@@ -634,7 +634,7 @@ document.addEventListener('alpine:init', () => { |
634 | 634 | event.preventDefault(); |
635 | 635 |
|
636 | 636 | const operationId = window.Hydro.generateGuid(); |
637 | | - el.setAttribute("hydro-operation-id", operationId); |
| 637 | + el.setAttribute("data-operation-id", operationId); |
638 | 638 |
|
639 | 639 | const eventName = `${scope}:${trigger.name}`; |
640 | 640 | const eventData = { |
|
0 commit comments