You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: public/styleguide/js/styleguide.js
+1-29Lines changed: 1 addition & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -384,11 +384,6 @@
384
384
var$sgSrc=$sgViewport.attr('src'),
385
385
$vp=$sgViewport.contents(),
386
386
$sgPattern=$vp.find('.sg-pattern');
387
-
388
-
//Inject styleguide CSS into iframe
389
-
//The styleguide CSS is being injected via Javascript as to keep the user-generated source code as clean as possible.
390
-
//Final code won't include any trace of Pattern Lab
391
-
$vp.find("head").prepend($("<link/>",{rel: "stylesheet",href: "../../styleguide/css/styleguide.css",type: "text/css"})).prepend('<!--styleguide.css is inserted for annotation and demo purposes. Will not be included in final code. -->');
392
387
393
388
//Code View Trigger
394
389
$('#sg-t-code').click(function(e){
@@ -402,19 +397,6 @@
402
397
$code.toggle();
403
398
}
404
399
});
405
-
406
-
//Annotation View Trigger
407
-
$('#sg-t-annotations').click(function(e){
408
-
var$annotations=$vp.find('.sg-annotations');
409
-
e.preventDefault();
410
-
$(this).toggleClass('active');
411
-
412
-
if($vp.find('.sg-annotations').length==0){
413
-
buildAnnotationView();
414
-
}else{
415
-
$annotations.toggle();
416
-
}
417
-
});
418
400
419
401
//Add code blocks after each pattern
420
402
functionbuildCodeView(){
@@ -427,17 +409,7 @@
427
409
});
428
410
$vp.find('.sg-code').show();
429
411
}
430
-
431
-
//Add annotation blocks after each pattern
432
-
functionbuildAnnotationView(){
433
-
$sgPattern.each(function(index){//Loop through each pattern
434
-
$this=$(this),
435
-
$thisAnnotation="This is an example of an annotation. Eventually this annotation will be replaced by a real annotation defined in an external JSON file.";//Example Annotation
436
-
437
-
$('<div class="sg-annotations" />').html($thisAnnotation).appendTo($this);//Create new node, fill it with the annotation text, then append it to the pattern
0 commit comments