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

Commit 3c29cc8

Browse files
committed
adding some simple comments
1 parent 408ee73 commit 3c29cc8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

public/styleguide/js/url-handler.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,10 @@ var urlHandler = {
129129
var fileName = urlHandler.getFileName(pattern);
130130
var expectedPath = window.location.protocol+"//"+window.location.host+window.location.pathname.replace("public/index.html","public/")+fileName;
131131
if (givenPath != expectedPath) {
132+
// make sure to update the iframe because there was a click
132133
document.getElementById("sg-viewport").contentWindow.postMessage( { "path": fileName }, urlHandler.targetOrigin);
133134
} else {
135+
// add to the history
134136
var addressReplacement = (window.location.protocol == "file:") ? null : window.location.protocol+"//"+window.location.host+window.location.pathname.replace("index.html","")+"?p="+pattern;
135137
history.pushState(data, null, addressReplacement);
136138
document.getElementById("title").innerHTML = "Pattern Lab - "+pattern;

0 commit comments

Comments
 (0)