diff --git a/app/assets/javascripts/snippet/snippet_embed.js b/app/assets/javascripts/snippet/snippet_embed.js index 872a04555a9..28a5ed306bd 100644 --- a/app/assets/javascripts/snippet/snippet_embed.js +++ b/app/assets/javascripts/snippet/snippet_embed.js @@ -6,7 +6,6 @@ export default () => { const embedAction = document.querySelector('#embed-action'); shareBtn.addEventListener('click', (event) => { - event.preventDefault(); shareBtn.classList.add('is-active'); embedBtn.classList.remove('is-active'); snippetUrlArea.value = `${protocol}//${host + pathname}`; @@ -14,7 +13,6 @@ export default () => { }); embedBtn.addEventListener('click', (event) => { - event.preventDefault(); embedBtn.classList.add('is-active'); shareBtn.classList.remove('is-active'); const scriptTag = ``; diff --git a/app/assets/stylesheets/framework/dropdowns.scss b/app/assets/stylesheets/framework/dropdowns.scss index 1d7b0b602cc..8dc3519a394 100644 --- a/app/assets/stylesheets/framework/dropdowns.scss +++ b/app/assets/stylesheets/framework/dropdowns.scss @@ -481,7 +481,7 @@ .dropdown-menu-selectable { li { - a { + a, button { padding: 8px 40px; position: relative; diff --git a/app/assets/stylesheets/framework/snippets.scss b/app/assets/stylesheets/framework/snippets.scss index 74f56e6e2f9..606d4675f19 100644 --- a/app/assets/stylesheets/framework/snippets.scss +++ b/app/assets/stylesheets/framework/snippets.scss @@ -63,7 +63,7 @@ margin-left: -1px; } - .embed-toggle-list li a { + .embed-toggle-list li button { padding: 8px 40px; } diff --git a/app/views/shared/snippets/_header.html.haml b/app/views/shared/snippets/_header.html.haml index 53d5416d120..2a704bb7e59 100644 --- a/app/views/shared/snippets/_header.html.haml +++ b/app/views/shared/snippets/_header.html.haml @@ -38,10 +38,10 @@ = sprite_icon('angle-down', size: 12) %ul.dropdown-menu.dropdown-menu-selectable.embed-toggle-list %li - %a#embed-btn.btn.btn-transparent.is-active{ href: "#" } + %button#embed-btn.btn.btn-transparent.is-active{ href: "#" } %strong.embed-toggle-list-item Embed %li - %a#share-btn.btn.btn-transparent{ href: "#" } + %button#share-btn.btn.btn-transparent{ href: "#" } %strong.embed-toggle-list-item Share %input#snippet-url-area.snippet-embed-input.form-control{ type: "text", autocomplete: 'off', value: snippet_embed } .input-group-btn