diff options
author | haseeb <haseebeqx@yahoo.com> | 2018-03-07 00:14:57 +0530 |
---|---|---|
committer | haseeb <haseebeqx@yahoo.com> | 2018-03-07 00:14:57 +0530 |
commit | 460d03b75f5087e74494cb31b28a8c7489f1ce2c (patch) | |
tree | e1c07b2d2a650d85e838862bda6cc9e39d69232a /app/assets/javascripts/snippet | |
parent | bf619dc62b7f848b1cbcaac41549f7bd5e616c87 (diff) | |
download | gitlab-ce-460d03b75f5087e74494cb31b28a8c7489f1ce2c.tar.gz |
changes to url posiion
Diffstat (limited to 'app/assets/javascripts/snippet')
-rw-r--r-- | app/assets/javascripts/snippet/snippet_embed.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/app/assets/javascripts/snippet/snippet_embed.js b/app/assets/javascripts/snippet/snippet_embed.js index 62af55addfc..700247cfdb3 100644 --- a/app/assets/javascripts/snippet/snippet_embed.js +++ b/app/assets/javascripts/snippet/snippet_embed.js @@ -4,19 +4,20 @@ export default () => { const embedBtn = document.querySelector('#embed-btn'); const snippetUrlArea = document.querySelector('#snippet-url-area'); const embedAction = document.querySelector('#embed-action'); + const url = `${protocol}//${host + pathname}`; shareBtn.addEventListener('click', () => { shareBtn.classList.add('is-active'); embedBtn.classList.remove('is-active'); - snippetUrlArea.value = `${protocol}//${host + pathname}`; - embedAction.innerHTML = 'Share'; + snippetUrlArea.value = url; + embedAction.innerText = 'Share'; }); embedBtn.addEventListener('click', () => { embedBtn.classList.add('is-active'); shareBtn.classList.remove('is-active'); - const scriptTag = `<script src="${protocol}//${host + pathname}.js"></script>`; + const scriptTag = `<script src="${url}.js"></script>`; snippetUrlArea.value = scriptTag; - embedAction.innerHTML = 'Embed'; + embedAction.innerText = 'Embed'; }); }; |