Skip to content

Commit

Permalink
Merge pull request #34 from hajekjiri/feature/update-try-button-style
Browse files Browse the repository at this point in the history
feat: update try button style
  • Loading branch information
wll8 authored Nov 1, 2023
2 parents e8005dd + 0aeb81f commit 3e57c9a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dist/try.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,10 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len

// Add try button
$(".http-verb").before("\n <button class=\"tryBtn\">".concat(cfg.tryText, "</button>\n "));
$(".tryBtn").click(function (event) {
$(".tryBtn").css({
lineHeight: '20px',
marginRight: '7px'
}).click(function (event) {
event.stopPropagation();
var $tryBtn = $(this);
$(".swaggerShadow").remove(); // First clear all temporary elements
Expand Down
5 changes: 4 additions & 1 deletion try.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,10 @@ function trySwagger(cfg) {
$(`.http-verb`).before(`
<button class="tryBtn">${cfg.tryText}</button>
`)
$(`.tryBtn`).click(function (event) {
$(`.tryBtn`).css({
lineHeight: '20px',
marginRight: '7px',
}).click(function (event) {
event.stopPropagation()
const $tryBtn = $(this)
$(`.swaggerShadow`).remove() // First clear all temporary elements
Expand Down

0 comments on commit 3e57c9a

Please sign in to comment.