Skip to content

Commit 27e0ed2

Browse files
Merge pull request #79 from HubSpot/lb-addTargetdClasses-option
introduce addTargetClasses option
2 parents e7e2d42 + 35e41ce commit 27e0ed2

File tree

13 files changed

+89
-78
lines changed

13 files changed

+89
-78
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "tether",
3-
"version": "0.7.0",
3+
"version": "0.7.1",
44
"main": "tether.js",
55
"homepage": "https://github.hubspot.com/tether",
66
"authors": [

coffee/abutment.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
addClasses.push "#{ @getClass('abutted') }-#{ side }"
3535

3636
defer =>
37-
updateClasses @target, addClasses, allClasses
37+
unless @options.addTargetClasses is false
38+
updateClasses @target, addClasses, allClasses
3839
updateClasses @element, addClasses, allClasses
3940

4041
true

coffee/constraint.coffee

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,8 @@ getBoundingRect = (tether, to) ->
254254
@updateAttachClasses eAttachment, tAttachment
255255

256256
defer =>
257-
updateClasses @target, addClasses, allClasses
257+
unless @options.addTargetClasses is false
258+
updateClasses @target, addClasses, allClasses
258259
updateClasses @element, addClasses, allClasses
259260

260261
{top, left}

coffee/tether.coffee

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,8 @@ class _Tether
173173
@[key] = document.querySelector @[key]
174174

175175
addClass @element, @getClass 'element'
176-
addClass @target, @getClass 'target'
176+
unless @options.addTargetClasses is false
177+
addClass @target, @getClass 'target'
177178

178179
if not @options.attachment
179180
throw new Error "Tether Error: You must provide an attachment"
@@ -285,7 +286,8 @@ class _Tether
285286
@_cache[k]
286287

287288
enable: (position=true) ->
288-
addClass @target, @getClass 'enabled'
289+
unless @options.addTargetClasses is false
290+
addClass @target, @getClass 'enabled'
289291
addClass @element, @getClass 'enabled'
290292
@enabled = true
291293

@@ -334,7 +336,8 @@ class _Tether
334336
return unless @_addAttachClasses?
335337

336338
updateClasses @element, @_addAttachClasses, all
337-
updateClasses @target, @_addAttachClasses, all
339+
unless @options.addTargetClasses is false
340+
updateClasses @target, @_addAttachClasses, all
338341

339342
@_addAttachClasses = undefined
340343

docs/css/intro.css

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
@charset "UTF-8";
22
*, *:after, *:before {
3-
-webkit-box-sizing: border-box;
43
-moz-box-sizing: border-box;
4+
-webkit-box-sizing: border-box;
55
box-sizing: border-box; }
66

77
body {
@@ -10,21 +10,21 @@ body {
1010
.yellow-box {
1111
width: 100px;
1212
height: 100px;
13-
background-color: #ffee88;
13+
background-color: #fe8;
1414
pointer-events: none; }
1515

1616
.green-box {
1717
margin-top: 65px;
1818
margin-left: 100px;
1919
width: 200px;
2020
height: 50px;
21-
background-color: #44ee99; }
21+
background-color: #4e9; }
2222
.no-green .green-box {
2323
display: none; }
2424

2525
.scroll-box {
2626
height: 150px;
27-
border: 10px solid #eeeeee;
27+
border: 10px solid #eee;
2828
background: #fbfbfb;
2929
overflow: auto;
3030
position: relative; }
@@ -40,7 +40,7 @@ pre.pre-with-output {
4040
float: left; }
4141
pre.pre-with-output code mark {
4242
background: #b8daff;
43-
color: black; }
43+
color: #000; }
4444

4545
p, h2, h3 {
4646
clear: both; }
@@ -63,7 +63,7 @@ output {
6363
text-align: center;
6464
font-size: 16px;
6565
font-variant: small-caps;
66-
color: #777777;
66+
color: #777;
6767
opacity: 1;
6868
transition: opacity 0.2s; }
6969
output.scrolled:after {
@@ -80,8 +80,8 @@ output {
8080
bottom: 0;
8181
opacity: 1;
8282
content: "Click To Show";
83-
background-color: #aaaaaa;
84-
border-left: 10px solid #eeeeee;
83+
background-color: #AAA;
84+
border-left: 10px solid #EEE;
8585
color: white;
8686
font-size: 24px;
8787
font-variant: normal;
@@ -177,7 +177,7 @@ span.attachment-mark:after, span.tether-marker-dot:after {
177177
line-height: 1.2;
178178
font-size: 15px;
179179
padding: 4px;
180-
color: #666666; }
180+
color: #666; }
181181
[data-example^="optimizer"] .scroll-box .tether-element:before {
182182
content: "I'm in my scroll parent!"; }
183183

@@ -193,21 +193,19 @@ span.attachment-mark:after, span.tether-marker-dot:after {
193193
.projects-paragraph {
194194
text-align: center; }
195195
.projects-paragraph a {
196-
display: -moz-inline-stack;
197196
display: inline-block;
198197
vertical-align: middle;
199198
*vertical-align: auto;
200-
zoom: 1;
199+
*zoom: 1;
201200
*display: inline;
202201
text-align: center;
203202
margin-right: 30px;
204203
color: inherit; }
205204
.projects-paragraph a span {
206-
display: -moz-inline-stack;
207205
display: inline-block;
208206
vertical-align: middle;
209207
*vertical-align: auto;
210-
zoom: 1;
208+
*zoom: 1;
211209
*display: inline;
212210
margin-bottom: 20px;
213211
font-size: 20px;

docs/welcome/css/browser-demo.css

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ html, body {
55

66
.tether.tether-theme-arrows-dark .tether-content {
77
-webkit-filter: none;
8-
-moz-filter: none;
98
filter: none;
10-
background: black; }
9+
background: #000; }
1110
.tether.tether-theme-arrows-dark .tether-content ul {
12-
color: white;
11+
color: #fff;
1312
list-style: none;
1413
padding: 0;
1514
margin: 0; }
1615

1716
.tether.tether-theme-arrows-dark.tether-element-attached-top.tether-element-attached-left.tether-target-attached-right .tether-content:before {
18-
border-right-color: black; }
17+
border-right-color: #000; }
1918

2019
.browser-demo {
2120
position: absolute;
@@ -24,8 +23,8 @@ html, body {
2423
bottom: 0;
2524
right: 0; }
2625
.browser-demo *, .browser-demo *:after, .browser-demo *:before {
27-
-webkit-box-sizing: border-box;
2826
-moz-box-sizing: border-box;
27+
-webkit-box-sizing: border-box;
2928
box-sizing: border-box; }
3029
.browser-demo .top {
3130
position: absolute;
@@ -51,7 +50,7 @@ html, body {
5150
cursor: pointer; }
5251
.browser-demo .bottom .left .item:hover, .browser-demo .bottom .left .item.tether-open {
5352
background: rgba(0, 0, 0, 0.1);
54-
border-bottom: 1px solid rgba(0, 0, 0, 0); }
53+
border-bottom: 1px solid transparent; }
5554
.browser-demo .bottom .left .item:last-child {
5655
border-bottom: 0; }
5756
.browser-demo .bottom .right {
@@ -61,22 +60,20 @@ html, body {
6160
height: 100%;
6261
padding: 20px; }
6362
.browser-demo .title {
64-
display: -moz-inline-stack;
6563
display: inline-block;
6664
vertical-align: middle;
6765
*vertical-align: auto;
68-
zoom: 1;
66+
*zoom: 1;
6967
*display: inline;
7068
background: rgba(0, 0, 0, 0.1);
7169
width: 150px;
7270
height: 15px;
7371
margin-bottom: 20px; }
7472
.browser-demo .word {
75-
display: -moz-inline-stack;
7673
display: inline-block;
7774
vertical-align: middle;
7875
*vertical-align: auto;
79-
zoom: 1;
76+
*zoom: 1;
8077
*display: inline;
8178
background: rgba(0, 0, 0, 0.1);
8279
width: 50px;

0 commit comments

Comments
 (0)