Skip to content

Commit accc85e

Browse files
authored
Merge pull request #62 from pzuraq/v2.0.0-beta.1
V2.0.0 beta.1
2 parents 519477d + d54ee3c commit accc85e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+640
-778
lines changed

.jshintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@
2828
"strict": false,
2929
"white": false,
3030
"eqnull": true,
31-
"esnext": true,
31+
"esversion": 6,
3232
"unused": true
3333
}

.travis.yml

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
language: node_js
33
node_js:
4-
- "0.12"
4+
- "4"
55

66
sudo: false
77

@@ -11,7 +11,7 @@ cache:
1111

1212
env:
1313
- EMBER_TRY_SCENARIO=default
14-
- EMBER_TRY_SCENARIO=ember-1-13
14+
- EMBER_TRY_SCENARIO=ember-1.13
1515
- EMBER_TRY_SCENARIO=ember-release
1616
- EMBER_TRY_SCENARIO=ember-beta
1717
- EMBER_TRY_SCENARIO=ember-canary
@@ -22,14 +22,17 @@ matrix:
2222
- env: EMBER_TRY_SCENARIO=ember-canary
2323

2424
before_install:
25-
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
26-
- "npm config set spin false"
27-
- "npm install -g npm@^2"
25+
- npm config set spin false
26+
- npm install -g bower
27+
- bower --version
28+
- npm install phantomjs-prebuilt
29+
- node_modules/phantomjs-prebuilt/bin/phantomjs --version
2830

2931
install:
30-
- npm install -g bower
3132
- npm install
3233
- bower install
3334

3435
script:
35-
- ember try $EMBER_TRY_SCENARIO test
36+
# Usually, it's ok to finish the test scenario without reverting
37+
# to the addon's original dependency state, skipping "cleanup".
38+
- ember try:one $EMBER_TRY_SCENARIO test --skip-cleanup

addon/components/liquid-tether.js

Lines changed: 35 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,7 @@ const { computed, get, observer, run } = Ember;
77
const { camelize } = Ember.String;
88

99
export default LiquidWormhole.extend({
10-
layout: layout,
11-
12-
to: 'liquid-tether',
10+
layout,
1311

1412
classPrefix: 'liquid-tether',
1513
target: null,
@@ -22,13 +20,21 @@ export default LiquidWormhole.extend({
2220
optimizations: null,
2321

2422
didInsertElement() {
25-
this._tetherElement = this.$('.liquid-tether')[0];
26-
2723
this._super.apply(this, arguments);
24+
25+
this._tetherElement = this.get('nodes')[0];
26+
},
27+
28+
willAppendNodes(bodyElement) {
29+
this.addTether(bodyElement);
2830
},
2931

3032
didAppendNodes() {
31-
this.addTether();
33+
this._tether.position();
34+
},
35+
36+
willRemoveNodes() {
37+
this._tether.position();
3238
},
3339

3440
willDestroyElement() {
@@ -39,10 +45,28 @@ export default LiquidWormhole.extend({
3945
});
4046
},
4147

42-
addTether() {
43-
if (get(this, '_tetherTarget')) {
44-
this._tether = new Tether(this._tetherOptions());
45-
}
48+
addTether(bodyElement) {
49+
const target = this.get('_tetherTarget');
50+
const element = this._tetherElement;
51+
52+
const options = { element, target, bodyElement };
53+
54+
[ 'classPrefix',
55+
'attachment',
56+
'targetAttachment',
57+
'offset',
58+
'targetOffset',
59+
'targetModifier',
60+
'constraints',
61+
'optimizations'
62+
].forEach((k) => {
63+
const v = get(this, k);
64+
if (!Ember.isNone(v)) {
65+
options[camelize(k)] = v;
66+
}
67+
});
68+
69+
this._tether = new Tether(options);
4670
},
4771

4872
removeTether() {
@@ -61,7 +85,7 @@ export default LiquidWormhole.extend({
6185
'targetModifier',
6286
'constraints',
6387
'optimizations',
64-
'liquidTarget',
88+
'to',
6589
function() {
6690
this.removeTether(this._tether);
6791
this.addTether();
@@ -78,29 +102,6 @@ export default LiquidWormhole.extend({
78102
return target;
79103
}),
80104

81-
_tetherOptions() {
82-
let options = {
83-
element: this._tetherElement,
84-
target: get(this, '_tetherTarget'),
85-
moveRoot: false
86-
};
87-
[ 'classPrefix',
88-
'attachment',
89-
'targetAttachment',
90-
'offset',
91-
'targetOffset',
92-
'targetModifier',
93-
'constraints',
94-
'optimizations'
95-
].forEach((k) => {
96-
const v = get(this, k);
97-
if (!Ember.isNone(v)) {
98-
options[camelize(k)] = v;
99-
}
100-
});
101-
return options;
102-
},
103-
104105
actions: {
105106
clickOverlay() {
106107
if (this.get('on-overlay-click')) {

addon/styles/addon.css

Lines changed: 149 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,150 @@
1-
.liquid-tether-element {
2-
position: absolute;
1+
.default-liquid-target .liquid-tether-container {
2+
animation : none !important;
3+
animation-delay : 0 !important;
4+
animation-direction : normal !important;
5+
animation-duration : 0 !important;
6+
animation-fill-mode : none !important;
7+
animation-iteration-count : 1 !important;
8+
animation-name : none !important;
9+
animation-play-state : running !important;
10+
animation-timing-function : ease !important;
11+
backface-visibility : visible !important;
12+
background : 0 !important;
13+
background-attachment : scroll !important;
14+
background-clip : border-box !important;
15+
background-color : transparent !important;
16+
background-image : none !important;
17+
background-origin : padding-box !important;
18+
background-position : 0 0 !important;
19+
background-position-x : 0 !important;
20+
background-position-y : 0 !important;
21+
background-repeat : repeat !important;
22+
background-size : auto auto !important;
23+
border : 0 !important;
24+
border-style : none !important;
25+
border-width : medium !important;
26+
border-color : inherit !important;
27+
border-bottom : 0 !important;
28+
border-bottom-color : inherit !important;
29+
border-bottom-left-radius : 0 !important;
30+
border-bottom-right-radius : 0 !important;
31+
border-bottom-style : none !important;
32+
border-bottom-width : medium !important;
33+
border-collapse : separate !important;
34+
border-image : none !important;
35+
border-left : 0 !important;
36+
border-left-color : inherit !important;
37+
border-left-style : none !important;
38+
border-left-width : medium !important;
39+
border-radius : 0 !important;
40+
border-right : 0 !important;
41+
border-right-color : inherit !important;
42+
border-right-style : none !important;
43+
border-right-width : medium !important;
44+
border-spacing : 0 !important;
45+
border-top : 0 !important;
46+
border-top-color : inherit !important;
47+
border-top-left-radius : 0 !important;
48+
border-top-right-radius : 0 !important;
49+
border-top-style : none !important;
50+
border-top-width : medium !important;
51+
bottom : auto !important;
52+
box-shadow : none !important;
53+
box-sizing : content-box !important;
54+
caption-side : top !important;
55+
clear : none !important;
56+
clip : auto !important;
57+
color : inherit !important;
58+
columns : auto !important;
59+
column-count : auto !important;
60+
column-fill : balance !important;
61+
column-gap : normal !important;
62+
column-rule : medium none currentColor !important;
63+
column-rule-color : currentColor !important;
64+
column-rule-style : none !important;
65+
column-rule-width : none !important;
66+
column-span : 1 !important;
67+
column-width : auto !important;
68+
content : normal !important;
69+
counter-increment : none !important;
70+
counter-reset : none !important;
71+
cursor : auto !important;
72+
direction : ltr !important;
73+
display : inline !important;
74+
empty-cells : show !important;
75+
float : none !important;
76+
font : normal !important;
77+
font-family : inherit !important;
78+
font-size : medium !important;
79+
font-style : normal !important;
80+
font-variant : normal !important;
81+
font-weight : normal !important;
82+
height : auto !important;
83+
hyphens : none !important;
84+
left : auto !important;
85+
letter-spacing : normal !important;
86+
line-height : normal !important;
87+
list-style : none !important;
88+
list-style-image : none !important;
89+
list-style-position : outside !important;
90+
list-style-type : disc !important;
91+
margin : 0 !important;
92+
margin-bottom : 0 !important;
93+
margin-left : 0 !important;
94+
margin-right : 0 !important;
95+
margin-top : 0 !important;
96+
max-height : none !important;
97+
max-width : none !important;
98+
min-height : 0 !important;
99+
min-width : 0 !important;
100+
opacity : 1 !important;
101+
orphans : 0 !important;
102+
outline : 0 !important;
103+
outline-color : invert !important;
104+
outline-style : none !important;
105+
outline-width : medium !important;
106+
overflow : visible !important;
107+
overflow-x : visible !important;
108+
overflow-y : visible !important;
109+
padding : 0 !important;
110+
padding-bottom : 0 !important;
111+
padding-left : 0 !important;
112+
padding-right : 0 !important;
113+
padding-top : 0 !important;
114+
page-break-after : auto !important;
115+
page-break-before : auto !important;
116+
page-break-inside : auto !important;
117+
perspective : none !important;
118+
perspective-origin : 50% 50% !important;
119+
position : static !important;
120+
/* May need to alter quotes for different locales (e.g fr) */
121+
quotes : '\201C' '\201D' '\2018' '\2019' !important;
122+
right : auto !important;
123+
tab-size : 8 !important;
124+
table-layout : auto !important;
125+
text-align : inherit !important;
126+
text-align-last : auto !important;
127+
text-decoration : none !important;
128+
text-decoration-color : inherit !important;
129+
text-decoration-line : none !important;
130+
text-decoration-style : solid !important;
131+
text-indent : 0 !important;
132+
text-shadow : none !important;
133+
text-transform : none !important;
134+
top : auto !important;
135+
transform : none !important;
136+
transform-style : flat !important;
137+
transition : none !important;
138+
transition-delay : 0s !important;
139+
transition-duration : 0s !important;
140+
transition-property : none !important;
141+
transition-timing-function : ease !important;
142+
unicode-bidi : normal !important;
143+
vertical-align : baseline !important;
144+
visibility : visible !important;
145+
white-space : normal !important;
146+
widows : 0 !important;
147+
width : auto !important;
148+
word-spacing : normal !important;
149+
z-index : auto !important;
3150
}
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
<div class="liquid-tether-overlay {{overlayClass}} {{if on-overlay-click 'clickable'}}" {{action 'clickOverlay'}}></div>
2-
<div class="liquid-tether {{tetherClass}}">
3-
{{yield}}
1+
<div class="liquid-tether-element">
2+
<div id={{wormholeId}} class="{{wormholeClass}} liquid-wormhole-element">
3+
{{yield}}
4+
</div>
45
</div>

app/transitions/tether.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,8 @@
11
import explode from './explode';
22

3-
export default function tether(tetherUse, overlayUse) {
4-
const transitions = [];
5-
transitions.push({
6-
pick: '.liquid-tether > :first-child',
7-
use: tetherUse
8-
});
9-
10-
if (overlayUse) {
11-
transitions.unshift({
12-
pick: '.liquid-tether-overlay',
13-
use: overlayUse
14-
});
15-
}
16-
17-
return explode.apply(this, transitions);
3+
export default function tether(transition, options = {}) {
4+
return explode.apply(this, [{
5+
pick: '.liquid-tether-element > :first-child',
6+
use: [transition, options]
7+
}]);
188
}

bower.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
"dependencies": {
44
"bootstrap-sass": "~3.3.5",
55
"flat-ui-sass": "~2.1.3",
6-
"ember": "~2.4.1",
7-
"ember-cli-shims": "0.1.0",
8-
"ember-cli-test-loader": "0.2.2",
9-
"ember-qunit-notifications": "0.1.0"
6+
"ember": "~2.8.0",
7+
"ember-cli-shims": "0.1.1"
108
}
119
}

config/ember-try.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
}
99
},
1010
{
11-
name: 'ember-1-13',
11+
name: 'ember-1.13',
1212
bower: {
1313
dependencies: {
1414
'ember': '~1.13.0'

0 commit comments

Comments
 (0)