changes based on review

This commit is contained in:
haseeb 2018-03-07 18:36:16 +05:30
parent c5cd31142b
commit 101c37085f
4 changed files with 13 additions and 13 deletions

View file

@ -1,9 +1,9 @@
export default () => { export default () => {
const { protocol, host, pathname } = location; const { protocol, host, pathname } = location;
const shareBtn = document.querySelector('#share-btn'); const shareBtn = document.querySelector('.js-share-btn');
const embedBtn = document.querySelector('#embed-btn'); const embedBtn = document.querySelector('.js-embed-btn');
const snippetUrlArea = document.querySelector('#snippet-url-area'); const snippetUrlArea = document.querySelector('.js-snippet-url-area');
const embedAction = document.querySelector('#embed-action'); const embedAction = document.querySelector('.js-embed-action');
const url = `${protocol}//${host + pathname}`; const url = `${protocol}//${host + pathname}`;
shareBtn.addEventListener('click', () => { shareBtn.addEventListener('click', () => {

View file

@ -22,9 +22,9 @@
height: 16px; height: 16px;
background-size: cover; background-size: cover;
&.gl-snippet-icon-doc_code { background-position: -0 -0; } &.gl-snippet-icon-doc_code { background-position: 0 0; }
&.gl-snippet-icon-doc_text { background-position: -0 -16px; } &.gl-snippet-icon-doc_text { background-position: 0 -16px; }
&.gl-snippet-icon-download { background-position: -0 -32px; } &.gl-snippet-icon-download { background-position: 0 -32px; }
} }
.blob-viewer { .blob-viewer {

View file

@ -116,7 +116,7 @@ module SnippetsHelper
raw_project_snippet_url(@snippet.project, @snippet) raw_project_snippet_url(@snippet.project, @snippet)
end end
link_to external_snippet_icon('doc_code'), snippet_raw_url, class: 'btn', target: '_blank', rel: 'noopener noreferrer', title: 'Open raw', data: { container: 'body' } link_to external_snippet_icon('doc_code'), snippet_raw_url, class: 'btn', target: '_blank', rel: 'noopener noreferrer', title: 'Open raw'
end end
def embedded_snippet_download_button def embedded_snippet_download_button

View file

@ -34,17 +34,17 @@
.input-group .input-group
.input-group-btn .input-group-btn
%button.btn.embed-toggle{ 'data-toggle': 'dropdown', type: 'button' } %button.btn.embed-toggle{ 'data-toggle': 'dropdown', type: 'button' }
%span#embed-action= _("Embed") %span.js-embed-action= _("Embed")
= sprite_icon('angle-down', size: 12) = sprite_icon('angle-down', size: 12)
%ul.dropdown-menu.dropdown-menu-selectable.embed-toggle-list %ul.dropdown-menu.dropdown-menu-selectable.embed-toggle-list
%li %li
%button#embed-btn.btn.btn-transparent.is-active{ type: 'button' } %button.js-embed-btn.btn.btn-transparent.is-active{ type: 'button' }
%strong.embed-toggle-list-item= _("Embed") %strong.embed-toggle-list-item= _("Embed")
%li %li
%button#share-btn.btn.btn-transparent{ type: 'button' } %button.js-share-btn.btn.btn-transparent{ type: 'button' }
%strong.embed-toggle-list-item= _("Share") %strong.embed-toggle-list-item= _("Share")
%input#snippet-url-area.snippet-embed-input.form-control{ type: "text", autocomplete: 'off', value: snippet_embed } %input.js-snippet-url-area.snippet-embed-input.form-control{ type: "text", autocomplete: 'off', value: snippet_embed }
.input-group-btn .input-group-btn
%button#clipboard-btn.btn.btn-default{ title: "Copy to clipboard", type: "button", data: { toggle: "tooltip", placement: "bottom", title: "Copy source to clipboard", container: "body", clipboard_target: '#snippet-url-area' } } %button.js-clipboard-btn.btn.btn-default.has-tooltip{ title: "Copy to clipboard", 'data-clipboard-target': '#snippet-url-area' }
= sprite_icon('duplicate', size: 16) = sprite_icon('duplicate', size: 16)
.clearfix .clearfix