@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glitchr/transparent",
3
- "version": "1.0.41",
3
+ "version": "1.0.43",
4
4
  "description": "Transparent SPA Application",
5
5
  "main": "src/index.js",
6
6
  "access": "public",
@@ -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.type == "file") {
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.setResponsePosition(history.state.uuid, Transparent.getScrollableElementXY());
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,