Skip to content

Commit 9d690df

Browse files
committed
v 1.3.20
1 parent e0e4eb2 commit 9d690df

File tree

3 files changed

+12
-29
lines changed

3 files changed

+12
-29
lines changed

dist/widgets.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "widgets",
3-
"version": "1.3.19",
3+
"version": "1.3.20",
44
"description": "Blockchain Visualization Widgets",
55
"main": "dist/widgets.js",
66
"directories": {

src/components/base.vue

Lines changed: 10 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -41,40 +41,23 @@
4141
},
4242
methods: {
4343
handleOpenIde: function() {
44+
let createHiddenField = function(name, value) {
45+
let input = document.createElement('input');
46+
input.setAttribute('type', 'hidden');
47+
input.setAttribute('name', name);
48+
input.setAttribute('value', value);
49+
return input;
50+
}
51+
4452
let form = document.createElement('form');
4553
form.setAttribute('method', 'post');
4654
form.setAttribute('action', this.data.ideUrl);
4755
form.setAttribute('target', '_blank');
48-
49-
let formData = new FormData();
50-
formData.append('query', this.data.query);
51-
formData.append('variables', JSON.stringify(this.data.variables));
56+
form.appendChild(createHiddenField('query', JSON.stringify(this.context.query.query)));
57+
form.appendChild(createHiddenField('variables', JSON.stringify(this.context.query.variables)));
5258
document.body.appendChild(form);
5359
form.submit();
5460
document.body.removeChild(form);
55-
56-
57-
// let wwindow = window.open()
58-
// fetch(this.data.ideUrl, {
59-
// method: 'POST',
60-
// headers: {
61-
// 'Content-Type': 'application/json',
62-
// Accept: 'application/json',
63-
// },
64-
// body: JSON.stringify({
65-
// query: this.context.query.query,
66-
// variables: JSON.stringify(this.context.query.variables),
67-
// }),
68-
// })
69-
// .then((res) => {
70-
// if (res.status === 200 || res.status === 302) {
71-
// wwindow.location.href = res.url
72-
// // window.open(res.url, '_blank').focus()
73-
// // res.redirect(302, res.url)
74-
// } else {
75-
// console.log(res.message)
76-
// }
77-
// })
7861
}
7962
}
8063
}

0 commit comments

Comments
 (0)