-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Ember 2.12 * Do some basic cleanup and simplification
- Loading branch information
1 parent
d0cc755
commit b3d04af
Showing
23 changed files
with
6,642 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = { | ||
root: true, | ||
parserOptions: { | ||
ecmaVersion: 6, | ||
sourceType: 'module' | ||
}, | ||
extends: 'eslint:recommended', | ||
env: { | ||
browser: true | ||
}, | ||
rules: { | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
.editorconfig | ||
.ember-cli | ||
.gitignore | ||
.jshintrc | ||
.eslintrc.js | ||
.watchmanconfig | ||
.travis.yml | ||
bower.json | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,27 @@ | ||
import Ember from 'ember'; | ||
import Component from 'ember-component'; | ||
import computed from 'ember-computed'; | ||
import layout from './template'; | ||
|
||
const { computed } = Ember; | ||
|
||
export default Ember.Component.extend({ | ||
export default Component.extend({ | ||
layout, | ||
tagName: '', | ||
tagName: 'label', | ||
attributeBindings: ['for', 'id'], | ||
classNames: ['toggle-text', 'toggle-prefix'], | ||
classNameBindings: ['labelType'], | ||
for: computed.readOnly('switchId'), | ||
id: computed('switchId', 'type', function() { | ||
const switchId = this.get('switchId'); | ||
const type = this.get('type'); | ||
return `${type}-label-${switchId}`; | ||
}), | ||
isVisible: computed.readOnly('show'), | ||
labelType: computed('type', function() { | ||
return `${this.get('type')}-label`; | ||
}), | ||
|
||
type: computed('value', { | ||
get() { | ||
let value = this.get('value'); | ||
return value ? 'on' : 'off'; | ||
return this.get('value') ? 'on' : 'off'; | ||
} | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,5 @@ | ||
{{#if show}} | ||
<label id='{{type}}-label-{{switchId}}' for={{switchId}} class="toggle-text toggle-prefix {{type}}-label" | ||
onclick={{action onClick value}}> | ||
{{#if hasBlock}} | ||
{{yield label}} | ||
{{else}} | ||
{{label}} | ||
{{/if}} | ||
</label> | ||
{{#if hasBlock}} | ||
{{yield label}} | ||
{{else}} | ||
{{label}} | ||
{{/if}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import Ember from 'ember'; | ||
import Component from 'ember-component'; | ||
import computed from 'ember-computed'; | ||
import layout from './template'; | ||
|
||
const { computed } = Ember; | ||
|
||
export default Ember.Component.extend({ | ||
export default Component.extend({ | ||
layout, | ||
tagName: '', | ||
|
||
themeClass: computed('theme', function () { | ||
var theme = this.get('theme') || 'default'; | ||
tagName: 'span', | ||
classNames: ['x-toggle-container'], | ||
classNameBindings: ['size', 'disabled:x-toggle-container-disabled', 'value:x-toggle-container-checked'], | ||
|
||
return 'x-toggle-' + theme; | ||
}), | ||
themeClass: computed('theme', function() { | ||
return `x-toggle-${this.get('theme') || 'default'}`; | ||
}) | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,18 @@ | ||
<span class="x-toggle-container {{size}}{{if value ' x-toggle-container-checked'}}{{if disabled ' x-toggle-container-disabled'}}"> | ||
<input id="{{forId}}" | ||
name={{name}} | ||
type='checkbox' | ||
checked={{toggled}} | ||
changed={{action onChangeValue value='target.checked'}} | ||
class='x-toggle' | ||
disabled={{disabled}}> | ||
<input | ||
checked={{toggled}} | ||
disabled={{disabled}} | ||
class='x-toggle' | ||
id={{forId}} | ||
name={{name}} | ||
onchange={{action onChangeValue value='target.checked'}} | ||
type='checkbox'> | ||
|
||
<div id="x-toggle-visual-{{forId}}" | ||
class="x-toggle-btn {{themeClass}} {{size}}{{if disabled ' x-toggle-disabled'}}" | ||
onclick={{action onClick}} | ||
data-tg-on={{onLabel}} | ||
data-tg-off={{offLabel}} | ||
for={{forId}} | ||
aria-role="checkbox" | ||
aria-owns={{forId}}> | ||
</div> | ||
</span> | ||
<div id="x-toggle-visual-{{forId}}" | ||
class="x-toggle-btn {{themeClass}} {{size}}{{if disabled ' x-toggle-disabled'}}" | ||
onclick={{action onClick}} | ||
data-tg-on={{onLabel}} | ||
data-tg-off={{offLabel}} | ||
for={{forId}} | ||
aria-role="checkbox" | ||
aria-owns={{forId}}> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/*jshint node:true*/ | ||
/* eslint-env node */ | ||
module.exports = { | ||
scenarios: [ | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.