Skip to content

Commit

Permalink
fix: version column resize when clipboard icon appears (#292)
Browse files Browse the repository at this point in the history
Use invisibility style to preserve clipboard icon space
  • Loading branch information
tancnle authored and bethesque committed Aug 25, 2019
1 parent e173f5c commit 5aa668e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/pact_broker/ui/views/index/show-with-tags.haml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
%td.consumer-version-number
%div.clippable
= escape_html(index_item.consumer_version_number)
%button.clippy.hidden{ title: "Copy to clipboard" }
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.glyphicon.glyphicon-copy
- if index_item.latest?
.tag.label.label-success
Expand All @@ -60,7 +60,7 @@
%td.provider-version-number
%div.clippable
= escape_html(index_item.provider_version_number)
%button.clippy.hidden{ title: "Copy to clipboard" }
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.glyphicon.glyphicon-copy
- index_item.provider_version_latest_tag_names.each do | tag_name |
.tag.label.label-primary
Expand Down
4 changes: 2 additions & 2 deletions lib/pact_broker/ui/views/matrix/show.haml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
%div.clippable
%a{href: line.consumer_version_number_url}
= line.display_consumer_version_number
%button.clippy.hidden{ title: "Copy to clipboard" }
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.glyphicon.glyphicon-copy
- line.latest_consumer_version_tags.each do | tag |
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
Expand All @@ -132,7 +132,7 @@
%div.clippable
%a{href: line.provider_version_number_url}
= line.display_provider_version_number
%button.clippy.hidden{ title: "Copy to clipboard" }
%button.clippy.invisible{ title: "Copy to clipboard" }
%span.glyphicon.glyphicon-copy
- line.latest_provider_version_tags.each do | tag |
.tag-parent{"title": tag.tooltip, "data-toggle": "tooltip", "data-placement": "right"}
Expand Down
4 changes: 2 additions & 2 deletions public/javascripts/clipboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @example in Haml
* %div.clippable
* = Text to be copied
* %button.clippy.hidden{ title: "Copy to clipboard" }
* %button.clippy.invisible{ title: "Copy to clipboard" }
* %span.glyphicon.glyphicon-copy
*/

Expand All @@ -17,7 +17,7 @@ function initializeClipper(selector) {
const elements = $(selector);

elements.hover(function() {
$(this).children(".clippy").toggleClass("hidden");
$(this).children(".clippy").toggleClass("invisible");
});

elements
Expand Down

0 comments on commit 5aa668e

Please sign in to comment.