Merge pull request #64 from edisonaugusthy/master

Added Copy response Button
This commit is contained in:
Liyas Thomas
2019-08-26 13:55:30 +05:30
committed by GitHub
2 changed files with 22 additions and 3 deletions

View File

@@ -234,6 +234,16 @@ ol li {
flex-direction: column;
flex-grow: 1;
}
.flex-wrap{
display: flex;
justify-content: space-between;
}
.btn-copy{
padding: 6px 14px;
font-size: 11px;
margin-right: 15px;
}
@media (max-width: $responsiveWidth) {
ul,
@@ -269,4 +279,4 @@ ol li {
.sv-error-response {
background-color: #b71c1c;
}
}

View File

@@ -146,9 +146,12 @@
</li>
</ul>
<ul>
<li>
<li>
<div class="flex-wrap">
<label for="body">response</label>
<textarea name="body" rows="10" readonly>{{response.body || '(waiting to send request)'}}</textarea>
<button v-if="response.body" name="action" class="btn-copy" @click="copyResponse">Copy Response</button>
</div>
<textarea name="body" rows="10" id="response-details" readonly>{{response.body || '(waiting to send request)'}}</textarea>
</li>
</ul>
</pw-section>
@@ -403,6 +406,12 @@
event.target.selectionStart = event.target.selectionEnd = oldSelectionStart + 2;
return false;
}
},
copyResponse() {
var copyText = document.getElementById("response-details");
copyText.select();
document.execCommand("copy");
}
}
}