@glitchr/transparent 1.0.45 → 1.0.46

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.45",
3
+ "version": "1.0.46",
4
4
  "description": "Transparent SPA Application",
5
5
  "main": "src/index.js",
6
6
  "access": "public",
@@ -469,6 +469,10 @@
469
469
  case "INPUT":
470
470
  case "BUTTON":
471
471
  var form = $(el).closest("form");
472
+ if (form.length) return form[0];
473
+
474
+ var formName = $(el).attr("name").split("[")[0];
475
+ form = $("form[name="+formName+"]");
472
476
  return (form.length ? form[0] : undefined);
473
477
  }
474
478
 
@@ -1634,7 +1638,7 @@
1634
1638
 
1635
1639
  dispatchEvent(new Event('transparent:'+switchLayout));
1636
1640
 
1637
- if($(dom).find("html").hasClass(Transparent.state.RELOAD))
1641
+ if($(dom).find("html").hasClass(Transparent.state.RELOAD) || $(dom).find("html").hasClass(Transparent.state.DISABLE))
1638
1642
  return window.location.reload();
1639
1643
 
1640
1644
  return Transparent.onLoad(uuid, dom, function() {
@@ -1658,7 +1662,7 @@
1658
1662
  // It is null when dev is pushing or replacing state
1659
1663
  var addNewState = !e.state;
1660
1664
  if (addNewState) {
1661
-
1665
+
1662
1666
  if(history.state)
1663
1667
  Transparent.setResponse(history.state.uuid, Transparent.html[0], Transparent.getScrollableElementXY());
1664
1668
 
@@ -1689,6 +1693,9 @@
1689
1693
  if (href != location.origin + location.pathname + location.hash)
1690
1694
  history.replaceState({uuid: uuidv4(), status: history.state ? history.state.status : 200, data:{}, method: history.state ? history.state.method : "GET", href: location.origin + location.pathname + location.hash}, '', location.origin + location.pathname + location.hash);
1691
1695
 
1696
+ if($("html").hasClass(Transparent.state.DISABLE))
1697
+ Settings.disable = true;
1698
+
1692
1699
  // Overload onpopstate
1693
1700
  if(Settings.disable) {
1694
1701