mirror of
https://github.com/pattern-lab/patternlab-php.git
synced 2025-01-17 22:29:12 +01:00
fixing a bad loop
This commit is contained in:
parent
6de3450990
commit
cd04a94dba
@ -127,7 +127,9 @@ var urlHandler = {
|
||||
pushPattern: function (pattern, givenPath) {
|
||||
var data = { "pattern": pattern };
|
||||
var fileName = urlHandler.getFileName(pattern);
|
||||
var expectedPath = window.location.protocol+"//"+window.location.host+window.location.pathname.replace("public/index.html","public/")+fileName;
|
||||
var path = window.location.pathname;
|
||||
path = (window.location.protocol === "file") ? path.replace("/public/index.html","public/") : path.replace(/\/index\.html/,"/");
|
||||
var expectedPath = window.location.protocol+"//"+window.location.host+path+fileName;
|
||||
if (givenPath != expectedPath) {
|
||||
// make sure to update the iframe because there was a click
|
||||
document.getElementById("sg-viewport").contentWindow.postMessage( { "path": fileName }, urlHandler.targetOrigin);
|
||||
|
Loading…
x
Reference in New Issue
Block a user