Skip to content

Commit

Permalink
fix action issue with form data in a bunch of other places
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepollak committed Mar 9, 2016
1 parent 397c69a commit c025167
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 29 deletions.
19 changes: 11 additions & 8 deletions assets/dist/js/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@
connectData = {
_wpnonce: this.opts.nonces.connectClef,
identifier: data.identifier,
state: data.state
state: data.state,
action: this.connectClefAction
};
failure = (function(_this) {
return function(msg) {
Expand All @@ -125,7 +126,7 @@
});
};
})(this);
return $.post(this.connectClefAction, connectData).success(function(data) {
return $.post("" + ajaxurl + "?action=" + this.connectClefAction, connectData).success(function(data) {
if (data.success) {
if (typeof cb === "function") {
return cb(data);
Expand Down Expand Up @@ -176,7 +177,7 @@
}
});
SetupTutorialView = TutorialView.extend({
connectClefAction: ajaxurl + "?action=connect_clef_account_clef_id",
connectClefAction: "connect_clef_account_clef_id",
iframePath: '/iframes/application/create/v2',
initialize: function(opts) {
opts.slideFilterSelector = '.setup';
Expand Down Expand Up @@ -257,7 +258,7 @@
}
});
ConnectTutorialView = TutorialView.extend({
connectClefAction: ajaxurl + "?action=connect_clef_account_oauth_code",
connectClefAction: "connect_clef_account_oauth_code",
render: function() {
this.addButton();
return this.constructor.__super__.render.call(this);
Expand Down Expand Up @@ -292,7 +293,7 @@
events: {
"click #disconnect": "disconnectClefAccount"
},
disconnectURL: ajaxurl + "?action=disconnect_clef_account",
disconnectAction: "disconnect_clef_account",
messageTemplate: _.template("<div class='<%=type%> connect-clef-message'><%=message%></div>"),
initialize: function(opts) {
this.opts = opts;
Expand All @@ -315,7 +316,7 @@
}
},
disconnectClefAccount: function(e) {
var failure;
var data, failure;
e.preventDefault();
failure = (function(_this) {
return function(msg) {
Expand All @@ -327,9 +328,11 @@
});
};
})(this);
return $.post(this.disconnectURL, {
data = {
action: this.disconnectClefAction,
_wpnonce: this.opts.nonces.disconnectClef
}).success((function(_this) {
};
return $.post("" + ajaxurl + "?action=" + this.disconnectAction, data).success((function(_this) {
return function(data) {
var msg;
if (data.success) {
Expand Down
2 changes: 1 addition & 1 deletion assets/dist/js/connect.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c025167

Please sign in to comment.