event listener 수정
This commit is contained in:
@@ -546,6 +546,12 @@ class APITester {
|
||||
console.log(model.queryParams);
|
||||
this.buildPath(model);
|
||||
editableInput.setValue(model.path);
|
||||
$('span.variable').off('mouseover');
|
||||
$('span.variable').off('mouseout');
|
||||
document.querySelectorAll('span.variable').forEach(element => {
|
||||
element.addEventListener('mouseover', () => me.showPopper(element));
|
||||
element.addEventListener('mouseout', () => me.hidePopper(element));
|
||||
});
|
||||
});
|
||||
|
||||
apiRequestTabContent.find(`#api_request_${model.id}`).find('.api_request_info').find('.path').each(function () {
|
||||
@@ -554,6 +560,12 @@ class APITester {
|
||||
model.path = value;
|
||||
model.queryParams = me.parseParam(model.path);
|
||||
propertyTable.setProperties(model.queryParams);
|
||||
$('span.variable').off('mouseover');
|
||||
$('span.variable').off('mouseout');
|
||||
document.querySelectorAll('span.variable').forEach(element => {
|
||||
element.addEventListener('mouseover', () => me.showPopper(element));
|
||||
element.addEventListener('mouseout', () => me.hidePopper(element));
|
||||
});
|
||||
});
|
||||
|
||||
$(this).append(`<label>Path</label>`);
|
||||
@@ -561,6 +573,7 @@ class APITester {
|
||||
$('span.variable').off('mouseover');
|
||||
$('span.variable').off('mouseout');
|
||||
|
||||
|
||||
});
|
||||
|
||||
document.querySelectorAll('.variable').forEach(element => {
|
||||
|
||||
@@ -68,7 +68,9 @@ class PropertyTableView {
|
||||
<div class="editable" data-name="value" data-value="${property.value}"></div>
|
||||
</div>
|
||||
<div class="prop-table-cell" style="width:100px;">
|
||||
<button type="button" class="btn btn-secondary btn-sm remove-property" data-index="${index}"><i class="fa fa-sharp fa-minus"></i></button>
|
||||
<button type="button" class="btn btn-secondary btn-sm remove-property" data-index="${index}">
|
||||
<i class="fa fa-sharp fa-minus" data-index="${index}"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@@ -115,6 +117,8 @@ class PropertyTableView {
|
||||
attachEventListeners() {
|
||||
this.element.querySelectorAll('.remove-property').forEach(button => {
|
||||
button.addEventListener('click', (event) => {
|
||||
console.log(event.target);
|
||||
console.log(event.target.getAttribute('data-index'));
|
||||
const index = parseInt(event.target.getAttribute('data-index'), 10);
|
||||
console.log({index});
|
||||
this.propertyTable.controller.removeProperty(index);
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user