-
Notifications
You must be signed in to change notification settings - Fork 331
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix offset when selecting tabs not totally visible. improve docs. cha…
…nge `name` to `value`.
- Loading branch information
1 parent
979bb66
commit bc90bea
Showing
9 changed files
with
267 additions
and
75 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
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 |
---|---|---|
|
@@ -6,7 +6,6 @@ module.exports = { | |
"Chrome" | ||
], | ||
"launch_in_dev": [ | ||
"PhantomJS", | ||
"Chrome" | ||
], | ||
'browser_args': { | ||
|
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,12 +1,59 @@ | ||
import Ember from 'ember'; | ||
const { Controller } = Ember; | ||
const { Controller, computed, A } = Ember; | ||
|
||
const LOREM = ` | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. | ||
Nulla venenatis ante augue. Phasellus volutpat neque ac dui mattis | ||
vulputate. Etiam consequat aliquam cursus. In sodales pretium ultrices. | ||
Maecenas lectus est, sollicitudin consectetur felis nec, feugiat ultricies mi.\n | ||
`; | ||
|
||
export default Controller.extend({ | ||
selectedNavItem: 1, | ||
selectedBasicTab: 0, | ||
|
||
chapters: computed(function() { | ||
let tabs = A(); | ||
for (let i = 1; i < 5; i++) { | ||
tabs.push({ | ||
index: i, | ||
title: `Chapter ${i}`, | ||
body: LOREM.repeat(i) | ||
}); | ||
} | ||
|
||
return tabs; | ||
}), | ||
|
||
selectedChapter: computed.reads('chapters.firstObject'), | ||
|
||
actions: { | ||
toggle(propName) { | ||
this.toggleProperty(propName); | ||
}, | ||
|
||
addChapter() { | ||
let index = Math.max(...this.get('chapters').mapBy('index')) + 1; | ||
let chapter = { | ||
index, | ||
title: this.get('newTitle'), | ||
body: this.get('newContent') | ||
}; | ||
this.get('chapters').pushObject(chapter); | ||
this.set('selectedChapter', chapter); | ||
this.setProperties({ | ||
newTitle: '', | ||
newContent: '' | ||
}); | ||
}, | ||
|
||
removeChapter(t) { | ||
if (this.get('selectedChapter') === t) { | ||
let chapters = this.get('chapters'); | ||
let index = chapters.indexOf(t); | ||
let newSelection = chapters.objectAt(index + 1) || chapters.objectAt(index - 1); | ||
this.set('selectedChapter', newSelection); | ||
} | ||
this.get('chapters').removeObject(t); | ||
} | ||
} | ||
}); |
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.