Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions core/styleguide/js/styleguide.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
$bodySize = parseInt($('body').css('font-size')), //Body size of the document,
$headerHeight = $('.sg-header').height(),
discoID = false,
fullMode = true,
discoMode = false,
hayMode = false;

Expand All @@ -20,6 +21,10 @@
sh = $(document).height();

setAccordionHeight();

if(fullMode == true) {
sizeiframe(sw, false);
}
});

// Accordion dropdown
Expand Down Expand Up @@ -73,6 +78,7 @@
e.preventDefault();
killDisco();
killHay();
fullMode = false;

var val = $(this).attr('data-size');

Expand All @@ -90,6 +96,7 @@
function goSmall() {
killDisco();
killHay();
fullMode = false;
sizeiframe(getRandom(minViewportWidth,500));
}

Expand All @@ -107,6 +114,7 @@
function goMedium() {
killDisco();
killHay();
fullMode = false;
sizeiframe(getRandom(500,800));
}

Expand All @@ -124,6 +132,7 @@
function goLarge() {
killDisco();
killHay();
fullMode = false;
sizeiframe(getRandom(800,1200));
}

Expand All @@ -142,6 +151,7 @@
e.preventDefault();
killDisco();
killHay();
fullMode = true;
sizeiframe(sw);
});

Expand All @@ -150,13 +160,15 @@
e.preventDefault();
killDisco();
killHay();
fullMode = false;
sizeiframe(getRandom(minViewportWidth,sw));
});

//Click for Disco Mode, which resizes the viewport randomly
$('#sg-size-disco').on("click", function(e){
e.preventDefault();
killHay();
fullMode = false;

if (discoMode) {
killDisco();
Expand Down Expand Up @@ -424,6 +436,8 @@
// capture default data
var origClientX = event.clientX;
var origViewportWidth = $sgViewport.width();

fullMode = false;

// show the cover
$("#sg-cover").css("display","block");
Expand Down