@glitchr/transparent 1.0.41 → 1.0.43
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/js/transparent.js +10 -4
package/package.json
CHANGED
package/src/js/transparent.js
CHANGED
|
@@ -1438,10 +1438,14 @@
|
|
|
1438
1438
|
if (form) {
|
|
1439
1439
|
|
|
1440
1440
|
data = new FormData();
|
|
1441
|
-
var formInput = $("[name^='"+form.name+"\[']");
|
|
1441
|
+
var formInput = $("form[name='"+form.name+"'] :input, [name^='"+form.name+"\[']");
|
|
1442
1442
|
formInput.each(function() {
|
|
1443
1443
|
|
|
1444
|
-
if(this.
|
|
1444
|
+
if(this.tagName == "BUTTON") {
|
|
1445
|
+
|
|
1446
|
+
if(this == e.target) data.append(this.name, this.value);
|
|
1447
|
+
|
|
1448
|
+
} else if(this.type == "file") {
|
|
1445
1449
|
|
|
1446
1450
|
for(var i = 0; i < this.files.length; i++)
|
|
1447
1451
|
data.append(this.name, field.files[i]);
|
|
@@ -1642,13 +1646,15 @@
|
|
|
1642
1646
|
// It is null when dev is pushing or replacing state
|
|
1643
1647
|
var addNewState = !e.state;
|
|
1644
1648
|
if (addNewState) {
|
|
1645
|
-
|
|
1649
|
+
|
|
1646
1650
|
if(history.state)
|
|
1647
|
-
Transparent.
|
|
1651
|
+
Transparent.setResponse(history.state.uuid, Transparent.html[0], Transparent.getScrollableElementXY());
|
|
1648
1652
|
|
|
1649
1653
|
$(Transparent.html).prop("user-scroll", false); // make sure to avoid page jump during transition (cancelled in activeIn callback)
|
|
1650
1654
|
|
|
1651
1655
|
// Submit ajax request..
|
|
1656
|
+
if(form) form.dispatchEvent(new Event("submit"));
|
|
1657
|
+
|
|
1652
1658
|
var xhr = new XMLHttpRequest();
|
|
1653
1659
|
return jQuery.ajax({
|
|
1654
1660
|
url: url.href,
|