Skip to content

Commit

Permalink
Merge pull request #7492 from ehuelsmann/cleanup/rm-clicked-action-wo…
Browse files Browse the repository at this point in the history
…rkaround

Cleanup clicked action workaround
  • Loading branch information
ehuelsmann committed Jul 9, 2023
2 parents 709b837 + 505118f commit a2bcb81
Showing 1 changed file with 7 additions and 18 deletions.
25 changes: 7 additions & 18 deletions UI/js-src/lsmb/Form.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,16 @@ define([
"dijit/form/Form",
"dojo/_base/declare",
"dojo/_base/event",
"dojo/on",
"dojo/dom-attr",
"dojo/dom-form",
"dojo/query",
"dijit/registry"
], function (Form, declare, event, on, domattr, domform, query, registry) {
], function (Form, declare, event, domattr, domform, registry) {
var c = 0;
return declare("lsmb/Form", [Form], {
clickedAction: null,
startup: function () {
var self = this;
this.inherited(arguments);

// <button> tags get rewritten to <input type="submit" tags...
query('input[type="submit"]', this.domNode).forEach(function (b) {
on(b, "click", function () {
self.clickedAction = b;
});
});
},
onSubmit: function (evt) {
event.stop(evt);
this.clickedAction = evt.submitter; /* ought to be the same as this.domNode.__action */
this.submit();
},
submit: function () {
Expand All @@ -34,10 +22,11 @@ define([
return;
}

var method =
const options = { handleAs: "text" };
const method =
typeof this.method === "undefined" ? "GET" : this.method;
var url = this.action;
var options = { handleAs: "text" };
let url = this.action; /* relative; this.domNode.action is absolute */

options.doing = widget["data-lsmb-doing"];
options.done = widget["data-lsmb-done"];
if (method.toLowerCase() === "get") {
Expand All @@ -47,7 +36,7 @@ define([
return;
}
c++;
var qobj = domform.toQuery(this.domNode);
let qobj = domform.toQuery(this.domNode);
qobj =
domattr.get(this.clickedAction, "name") +
"=" +
Expand Down

0 comments on commit a2bcb81

Please sign in to comment.