Skip to content

Commit 7579792

Browse files
committed
fix(object_editor): fix send button
Closes #804
1 parent 46c4b38 commit 7579792

File tree

1 file changed

+22
-12
lines changed
  • src/modules/types/edition/object_editor

1 file changed

+22
-12
lines changed

src/modules/types/edition/object_editor/view.js

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,27 +45,37 @@ define(['modules/default/defaultview', 'src/util/util', 'jsoneditor', 'src/util/
4545
}
4646
this.module.controller.sendValue(result, 'onObjectChange');
4747
},
48+
onModeChange: () => {
49+
console.log('mode changed')
50+
this.setSendButton();
51+
},
52+
4853
search: this.module.getConfigurationCheckbox('searchBox', 'search')
4954
});
5055

5156
if (this.module.getConfigurationCheckbox('sendButton', 'send')) {
52-
var sendButton = this.dom
53-
.find('.jsoneditor-menu')
54-
.prepend('<button class="send" style="width: 45px; float: left; background: none; font-size: small;">\n <span style="font-size: 10pt;">Send</span>\n</button>')
55-
.find('button.send');
56-
57-
sendButton.on('click', () => {
58-
this.module.controller.sendValue(this.editor.get(), 'onObjectSend');
59-
}).on('mouseenter', function () {
60-
$(this).css('background-color', '#f0f2f5');
61-
}).on('mouseleave', function () {
62-
$(this).css('background-color', '#e3eaf6');
63-
}).css('background-color', '#e3eaf6');
57+
this.setSendButton();
6458
}
6559

6660
this.update.value.call(this, this.inputData);
6761
this.resolveReady();
6862
},
63+
64+
setSendButton: function () {
65+
66+
var sendButton = this.dom
67+
.find('.jsoneditor-menu')
68+
.prepend('<button class="send" style="width: 45px; float: left; background: none; font-size: small;">\n <span style="font-size: 10pt; color: black">Send</span>\n</button>')
69+
.find('button.send');
70+
71+
sendButton.on('click', () => {
72+
this.module.controller.sendValue(this.editor.get(), 'onObjectSend');
73+
}).on('mouseenter', function () {
74+
$(this).css('background-color', '#f0f2f5');
75+
}).on('mouseleave', function () {
76+
$(this).css('background-color', '#e3eaf6');
77+
}).css('background-color', '#e3eaf6');
78+
},
6979
update: {
7080
value(value) {
7181
if (this.module.getConfigurationCheckbox('displayValue', 'display')) {

0 commit comments

Comments
 (0)