Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/pat/push/push.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ define(
$(document.body).on("push", function (e, data) {
logger.debug('received push marker');
if (data === this.options.pushId) {
// TODO: use async / await in here in the future and simplify code
if (this.$el.is("form")) {
var url = this.options.url || this.$el.attr("action") || false;
if (url) {
var action = this.$el.attr("method").toLowerCase() === "post" ? "post" : "get";
$[action]({
url: url,
data: $(this).serializeArray()
}).success(() => this.perform_inject());
// injection already done in case of successful submit.
// return now.
return;
}
}
this.perform_inject();
}
}.bind(this));
Expand Down