Sha256: b722a96ec4c44b484180b1101a27ceb72dc0ddcb64e2ede138ccb3b1083e4541
Contents?: true
Size: 815 Bytes
Versions: 2
Compression:
Stored size: 815 Bytes
Contents
pw.component.register("mutable",function(e,t){this.mutation=function(t){if(!window.socket)return void e.node.submit();var o=pw.util.dup(t);delete o.__nested,delete o.scope,delete o.id;var n={action:"call-route"};if("FORM"===e.node.tagName){if(e.node.querySelector('input[type="file"]'))return void e.node.submit();var i,r=e.node.querySelector('input[name="_method"]');i=r?r.value:e.node.getAttribute("method"),n.method=i,n.uri=e.node.getAttribute("action"),n.input=pw.node.serialize(e.node)}else{var a={};a[t.scope]=o,n.input=a}var d=this;window.socket.send(n,function(e){if(302===e.status&&e.headers.Location!==window.location.pathname){var t=e.headers.Location;return void history.pushState({uri:t},t,t)}400===e.status||d.state.rollback(),pw.component.broadcast("response:received",{response:e}),d.revert()})}});
Version data entries
2 entries across 2 versions & 1 rubygems