Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 3dd5fb2

Browse files
committed
Add popup code viewer to patterns page
1 parent 67ac18d commit 3dd5fb2

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

public/styleguide/css/styleguide.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@
529529
padding: 1em; }
530530

531531
/* Annotations */
532-
#sg-annotation-container {
532+
#sg-annotation-container, #sg-code-container {
533533
-moz-box-sizing: border-box;
534534
-webkit-box-sizing: border-box;
535535
box-sizing: border-box;
@@ -550,10 +550,10 @@
550550
-ms-transition: bottom 0.3s ease-out;
551551
-o-transition: bottom 0.3s ease-out;
552552
transition: bottom 0.3s ease-out; }
553-
#sg-annotation-container a {
553+
#sg-annotation-container a, #sg-code-container a {
554554
color: #dddddd; }
555555

556-
#sg-annotation-close-btn {
556+
#sg-annotation-close-btn, #sg-code-close-btn {
557557
color: #fff;
558558
position: absolute;
559559
top: 1em;

public/styleguide/css/styleguide.scss

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ $animate-quick: 0.2s;
767767

768768

769769
/* Annotations */
770-
#sg-annotation-container {
770+
#sg-annotation-container, #sg-code-container {
771771
-moz-box-sizing: border-box;
772772
-webkit-box-sizing: border-box;
773773
box-sizing: border-box;
@@ -794,7 +794,7 @@ $animate-quick: 0.2s;
794794
}
795795
}
796796

797-
#sg-annotation-close-btn {
797+
#sg-annotation-close-btn, #sg-code-close-btn {
798798
color: #fff;
799799
position: absolute;
800800
top: 1em;
@@ -808,7 +808,6 @@ $animate-quick: 0.2s;
808808
cursor: help !important;
809809
}
810810

811-
812811
// Icon Font
813812

814813
@font-face {

public/styleguide/js/code-viewer.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ var codeViewer = {
1616

1717
$('body').addClass('code-ready');
1818
$('#sg-t-code').click(function(e) {
19-
2019
e.preventDefault();
2120

2221
// make sure the annotations overlay is off
@@ -56,7 +55,7 @@ var codeViewer = {
5655
codeContainerInit: function() {
5756

5857
if (document.getElementById("sg-code-container") == undefined) {
59-
$('<div id="sg-code-container" style="display: none;"></div>').html('<a href="#" id="sg-code-close-btn">Close</a><div id="sg-code-lineage" style="display: none;"><h2>Lineage</h2><p>This pattern contains the following patterns: <span id="sg-code-lineage-fill"></span></p></div><div id="sg-code-html"><h2>HTML</h2><pre><code id="sg-code-html-fill" class="language-markup"></code></pre></div><div id="sg-code-css" style="display: none;"><h2>CSS</h2><pre><code id="sg-code-css-fill" class="language-css"></code></pre></div>').appendTo('body').css('bottom',-$(document).outerHeight());
58+
$('<div id="sg-code-container" style="display: none;"></div>').html('<a href="#" id="sg-code-close-btn">Close</a><div id="sg-code-lineage" style="display: none;"><h2>Lineage</h2><p>This pattern contains the following patterns: <span id="sg-code-lineage-fill"></span></p></div><div id="sg-code-html"><h2>HTML</h2><pre><code id="sg-code-html-fill" class="language-markup"></code></pre></div>').appendTo('body').css('bottom',-$(document).outerHeight());
6059
}
6160

6261
if (codeViewer.sw < codeViewer.breakpoint) {

0 commit comments

Comments
 (0)