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

Commit 6216c06

Browse files
committed
Merge branch 'release-v0.7.1'
2 parents 4f496a1 + 9b9bf6a commit 6216c06

File tree

10 files changed

+39
-39
lines changed

10 files changed

+39
-39
lines changed

CHANGELOG

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
THIS CHANGELOG IS AN ATTEMPT TO DOCUMENT CHANGES TO THIS PROJECT.
22

3+
PL-v0.7.1
4+
- FIX: annotation event should only fire when overlay is active
5+
- FIX: styleguide should properly sort patterns
6+
- THX: thanks to @jplhomer for the heads up on the annotations issue
7+
- THX: thanks to @tylersticka for the heads up on the styleguide issue
8+
39
PL-v0.7.0
410
- ADD: auto-reload server can be started directly from the watcher
511
- ADD: pattern parameter support

core/builder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Builder CLI - v0.7.0
4+
* Pattern Lab Builder CLI - v0.7.1
55
*
66
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

core/config/config.ini.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* If config.ini doesn't exist Pattern Lab will try to create a new version
44
*/
55

6-
v = "0.7.0"
6+
v = "0.7.1"
77

88
// file extensions to ignore when building or watching the source dir, separate with a comma
99
ie = "scss,DS_Store,less"

core/lib/PatternLab/Builder.php

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Builder Class - v0.7.0
4+
* Pattern Lab Builder Class - v0.7.1
55
*
66
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license
@@ -206,9 +206,6 @@ protected function generateMainPages() {
206206
}
207207
}
208208

209-
// sort partials by patternLink
210-
usort($sd['partials'], "PatternLab\Builder::sortPartials");
211-
212209
// render the "view all" pages
213210
$this->generateViewAllPages();
214211

@@ -1134,17 +1131,6 @@ public function trim(&$v) {
11341131
$v = trim($v);
11351132
}
11361133

1137-
/**
1138-
* Sort the partials generated for the styleguide so that any new ones show up in the correct place
1139-
* @param {Array} items from from one pattern to compare
1140-
* @param {Array} items from another pattern to compare
1141-
*
1142-
* @return {Integer} the result of the string comparison
1143-
*/
1144-
public function sortPartials($a,$b) {
1145-
return strcmp($a["patternLink"],$b["patternLink"]);
1146-
}
1147-
11481134
/**
11491135
* Lowercase the given string. Used in the array_walk() function in __construct as a sanity check
11501136
* @param {String} an entry from one of the list-based config entries

core/lib/PatternLab/Configurer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Configurer Class - v0.7.0
4+
* Pattern Lab Configurer Class - v0.7.1
55
*
66
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

core/lib/PatternLab/Generator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Generator Class - v0.7.0
4+
* Pattern Lab Generator Class - v0.7.1
55
*
66
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

core/lib/PatternLab/Migrator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Migrator Class - v0.7.0
4+
* Pattern Lab Migrator Class - v0.7.1
55
*
66
* Copyright (c) 2014 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

core/lib/PatternLab/Watcher.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

33
/*!
4-
* Pattern Lab Watcher Class - v0.7.0
4+
* Pattern Lab Watcher Class - v0.7.1
55
*
66
* Copyright (c) 2013-2014 Dave Olsen, http://dmolsen.com
77
* Licensed under the MIT license

core/styleguide/js/annotations-pattern.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ var annotationsPattern = {
3737
els[i].onclick = (function(item) {
3838
return function(e) {
3939

40-
e.preventDefault();
41-
e.stopPropagation();
42-
var obj = {};
43-
44-
// if an element was clicked on while the overlay was already on swap it
45-
obj = { "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment };
46-
47-
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
48-
parent.postMessage(obj,targetOrigin);
40+
if (annotationsPattern.commentsOverlayActive) {
41+
42+
e.preventDefault();
43+
e.stopPropagation();
44+
var obj = {};
45+
46+
// if an element was clicked on while the overlay was already on swap it
47+
obj = { "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment };
48+
49+
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
50+
parent.postMessage(obj,targetOrigin);
51+
52+
}
4953

5054
}
5155
})(item);

public/styleguide/js/annotations-pattern.js

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,19 @@ var annotationsPattern = {
3737
els[i].onclick = (function(item) {
3838
return function(e) {
3939

40-
e.preventDefault();
41-
e.stopPropagation();
42-
var obj = {};
43-
44-
// if an element was clicked on while the overlay was already on swap it
45-
obj = { "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment };
46-
47-
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
48-
parent.postMessage(obj,targetOrigin);
40+
if (annotationsPattern.commentsOverlayActive) {
41+
42+
e.preventDefault();
43+
e.stopPropagation();
44+
var obj = {};
45+
46+
// if an element was clicked on while the overlay was already on swap it
47+
obj = { "displaynumber": item.displaynumber, "el": item.el, "title": item.title, "comment": item.comment };
48+
49+
var targetOrigin = (window.location.protocol == "file:") ? "*" : window.location.protocol+"//"+window.location.host;
50+
parent.postMessage(obj,targetOrigin);
51+
52+
}
4953

5054
}
5155
})(item);

0 commit comments

Comments
 (0)