Skip to content

Commit

Permalink
Support latest Ember CLI 0.2.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Asaf Shakarzy committed May 19, 2015
1 parent 53ede6c commit 49902e0
Show file tree
Hide file tree
Showing 22 changed files with 180 additions and 157 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ indent_style = space
indent_size = 2

[*.hbs]
insert_final_newline = false
indent_style = space
indent_size = 2

Expand All @@ -29,5 +30,5 @@ indent_size = 2
indent_style = space
indent_size = 2

[*.md]
[*.{diff,md}]
trim_trailing_whitespace = false
14 changes: 14 additions & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
bower_components/
tests/
tmp/
dist/

.bowerrc
.editorconfig
.ember-cli
.travis.yml
.npmignore
**/.gitkeep
bower.json
Brocfile.js
testem.json
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,27 @@
---
language: node_js
node_js:
- "0.12"

sudo: false

cache:
directories:
- node_modules

env:
- EMBER_TRY_SCENARIO=default
- EMBER_TRY_SCENARIO=ember-release
- EMBER_TRY_SCENARIO=ember-beta
- EMBER_TRY_SCENARIO=ember-canary

matrix:
fast_finish: true
allow_failures:
- env: EMBER_TRY_SCENARIO=ember-canary

before_install:
- export PATH=/usr/local/phantomjs-2.0.0/bin:$PATH
- "npm config set spin false"
- "npm install -g npm@^2"

Expand All @@ -17,4 +31,4 @@ install:
- bower install

script:
- npm test
- ember try $EMBER_TRY_SCENARIO test
2 changes: 1 addition & 1 deletion Brocfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ var extraAssets = pickFiles('bower_components/fontawesome', {
destDir: '/'
});

module.exports = mergeTrees([app.toTree(), extraAssets])
module.exports = mergeTrees([app.toTree(), extraAssets])
23 changes: 12 additions & 11 deletions addon/tab-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import Em from 'ember';
import WithConfigMixin from 'ember-idx-utils/mixin/with-config';
var computed = Em.computed;
var on = Em.on;

/**
* `{{em-tab-list}}` component.
Expand All @@ -13,14 +14,14 @@ var computed = Em.computed;
*/

export default Em.Component.extend(WithConfigMixin, {
setTagName: (function() {
setTagName: on('init', function() {
return this.set('tagName', this.get('config.tabs.tabListTag') || 'div');
}).on('init'),
}),
classNameBindings: ['styleClasses'],
styleClasses: (function() {
styleClasses: Em.computed(function() {
var _ref;
return (_ref = this.get('config.tabs.tabListClasses')) != null ? _ref.join(" ") : void 0;
}).property(),
}),

/**
* The ancestor `Tabs` component
Expand Down Expand Up @@ -51,31 +52,31 @@ export default Em.Component.extend(WithConfigMixin, {
* @property selectedIdx
* @type Number
*/
selectedIdx: (function() {
selectedIdx: computed('selected', function() {
return this.get('tab_instances').indexOf(this.get('selected'));
}).property('selected'),
}),

/**
* Auto register this `TabList` in the ancestor tabs component.
*
* @method register
* @private
*/
register: (function() {
register: on('didInsertElement', function() {
return this.get('tabs').setTabList(this);
}).on('didInsertElement'),
}),

/**
* Initialize an empty tabs array
*
* @method initTabs
* @private
*/
initTabs: (function() {
initTabs: on('init', function() {
return this.set('tab_instances', Em.ArrayProxy.create({
content: []
content: Em.A()
}));
}).on('init'),
}),

/**
* Add a tab to the tab list
Expand Down
24 changes: 12 additions & 12 deletions addon/tab-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ var computed = Em.computed;

export default Em.Component.extend(WithConfigMixin, StyleBindingsMixin, {
classNameBindings: ['styleClasses'],
styleClasses: (function() {
styleClasses: Em.computed(function() {
var _ref;
return (_ref = this.get('config.tabs.tabPanelClasses')) != null ? _ref.join(" ") : void 0;
}).property(),
}),
styleBindings: ['height'],
attributeBindings: ['selected'],

Expand Down Expand Up @@ -43,22 +43,22 @@ export default Em.Component.extend(WithConfigMixin, StyleBindingsMixin, {
* @property tab
* @type Tab
*/
tab: (function() {
tab: Em.computed('panels.length', 'tabList.tab_instances.@each', function() {
var index, tabs;
index = this.get('panels').indexOf(this);
tabs = this.get('tabList.tab_instances');
return tabs && tabs.objectAt(index);
}).property('panels.length', 'tabList.tab_instances.@each'),
selected: (function() {
}),
selected: Em.computed('tab', 'tab.selected', function() {
return this.get('tab.selected');
}).property('tab', 'tab.selected'),
changeVisibility: (function() {
}),
changeVisibility: Em.observer('selected', function() {
return this.$().css('display', this.get('selected') ? "" : 'none');
}).observes('selected'),
register: (function() {
}),
register: Em.on('didInsertElement', function() {
return this.get('tabs').addTabPanel(this);
}).on('didInsertElement'),
unregister: (function() {
}),
unregister: Em.on('willDestroyElement', function() {
return this.get('tabs').removeTabPanel(this);
}).on('willDestroyElement')
})
});
40 changes: 20 additions & 20 deletions addon/tab.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ var computed = Em.computed;
* @class Tab
*/
export default Em.Component.extend(WithConfigMixin, {
setTagName: (function() {
setTagName: Em.on('init', function() {
return this.set('tagName', this.get('config.tabs.tabTag') || 'div');
}).on('init'),
}),

/**
* Bind the specified attributes to the DOM element
Expand All @@ -23,19 +23,19 @@ export default Em.Component.extend(WithConfigMixin, {
attributeBindings: ['active'],
classNameBindings: ['styleClasses', 'selectedClass'],

styleClasses: (function() {
styleClasses: computed(function() {
var _ref;
return (_ref = this.get('config.tabs.tabClasses')) != null ? _ref.join(" ") : void 0;
}).property(),
}),

selectedClass: (function() {
selectedClass: computed('selected', function() {
var _ref;
if (this.get('selected')) {
return (_ref = this.get('config.tabs.tabSelectedClasses')) != null ? _ref.join(" ") : void 0;
} else {
return null;
}
}).property('selected'),
}),

/**
* A reference to the {{#crossLink "Tabs"}}Tabs{{/crossLink}} instance.
Expand All @@ -59,21 +59,21 @@ export default Em.Component.extend(WithConfigMixin, {
* @property selected
* @type Boolean
*/
selected: (function() {
selected: computed('tabs.selected', function() {
return this.get('tabs.selected') === this;
}).property('tabs.selected'),
}),

active: (function() {
active: computed('selected', function() {
if (this.get('selected')) {
return "true";
} else {
return null;
}
}).property('selected'),
}),

index: (function() {
index: computed('tabList.tab_instances.@each', function() {
return this.get('tabList.tab_instances').indexOf(this);
}).property('tabList.tab_instances.@each'),
}),

/**
* Select this tab.
Expand All @@ -82,17 +82,17 @@ export default Em.Component.extend(WithConfigMixin, {
*
* @method select
*/
select: (function() {
select: Em.on('click', function() {
return this.get('tabs').select(this);
}).on('click'),
}),

/**
* Select this tab if it matches the {{#crossLink "Tabs/select:method"}}selected-idx{{/crossLink}} property set by the Tabs component.
*
* @method selectByTabsParam
* @private
*/
selectByTabsParam: (function() {
selectByTabsParam: Em.on('didInsertElement', Em.observer('tabs.selected-idx', function() {
var idx;
if ((this.get('tabs.selected') != null) === this) {
return;
Expand All @@ -101,25 +101,25 @@ export default Em.Component.extend(WithConfigMixin, {
if (idx === this.get('index')) {
return this.select();
}
}).observes('tabs.selected-idx').on('didInsertElement'),
})),

/**
* Register this tab in the {{#crossLink "TabList"}}{{/crossLink}} component instance.
*
* @method register
* @private
*/
register: (function() {
register: Em.on('didInsertElement', function() {
return this.get('tabList').addTab(this);
}).on('didInsertElement'),
}),

/**
* Unregister this tab from the {{#crossLink "TabList"}}{{/crossLink}} component instance.
*
* @method unregister
* @private
*/
unregister: (function() {
unregister: Em.on('willDestroyElement', function() {
return this.get('tabList').removeTab(this);
}).on('willDestroyElement')
})
});
10 changes: 5 additions & 5 deletions addon/tabs.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ import StyleBindingsMixin from 'ember-idx-utils/mixin/style-bindings';
export default Em.Component.extend(WithConfigMixin, StyleBindingsMixin, {
debug: false,
classNameBindings: ['styleClasses'],
styleClasses: (function() {
styleClasses: Em.computed(function() {
var _ref;
return (_ref = this.get('config.tabs.tabsClasses')) != null ? _ref.join(" ") : void 0;
}).property(),
}),
styleBindings: ['height'],

/**
Expand Down Expand Up @@ -92,11 +92,11 @@ export default Em.Component.extend(WithConfigMixin, StyleBindingsMixin, {
*
* @method initTabPanels
*/
initTabPanels: (function() {
initTabPanels: Em.on('init', function() {
return this.set('panels', Em.ArrayProxy.create({
content: []
content: Em.A()
}));
}).on('init'),
}),

/**
* Set the specified `TabList` instance.
Expand Down
23 changes: 11 additions & 12 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
{
"name": "ember-idx-tabs",
"dependencies": {
"handlebars": "~1.3.0",
"ember": "1.12.0",
"ember-cli-shims": "ember-cli/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "ember-cli-test-loader#0.1.3",
"ember-data": "1.0.0-beta.17",
"ember-load-initializers": "ember-cli/ember-load-initializers#0.1.4",
"ember-qunit": "0.3.3",
"ember-qunit-notifications": "0.0.7",
"ember-resolver": "~0.1.15",
"jquery": "^1.11.1",
"ember": "1.8.1",
"ember-data": "1.0.0-beta.12",
"ember-resolver": "~0.1.10",
"loader.js": "stefanpenner/loader.js#1.0.1",
"ember-cli-shims": "stefanpenner/ember-cli-shims#0.0.3",
"ember-cli-test-loader": "rwjblue/ember-cli-test-loader#0.0.4",
"ember-load-initializers": "stefanpenner/ember-load-initializers#0.0.2",
"ember-qunit": "0.1.8",
"ember-qunit-notifications": "0.0.4",
"qunit": "~1.15.0"
"loader.js": "ember-cli/loader.js#3.2.0",
"qunit": "~1.17.1"
},
"devDependencies": {
"bootstrap": "~3.3.1",
"fontawesome": "~4.2.0",
"highlightjs": "~8.4.0"
}
}
}
35 changes: 35 additions & 0 deletions config/ember-try.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
module.exports = {
scenarios: [
{
name: 'default',
dependencies: { }
},
{
name: 'ember-release',
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
},
{
name: 'ember-beta',
dependencies: {
'ember': 'components/ember#beta'
},
resolutions: {
'ember': 'beta'
}
},
{
name: 'ember-canary',
dependencies: {
'ember': 'components/ember#canary'
},
resolutions: {
'ember': 'canary'
}
}
]
};
Loading

0 comments on commit 49902e0

Please sign in to comment.