Skip to content

Commit 8ee4523

Browse files
committed
Initial commit
0 parents  commit 8ee4523

39 files changed

+570
-0
lines changed

.bowerrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"directory": "bower_components",
3+
"analytics": false
4+
}

.editorconfig

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# EditorConfig helps developers define and maintain consistent
2+
# coding styles between different editors and IDEs
3+
# editorconfig.org
4+
5+
root = true
6+
7+
8+
[*]
9+
end_of_line = lf
10+
charset = utf-8
11+
trim_trailing_whitespace = true
12+
insert_final_newline = true
13+
indent_style = space
14+
indent_size = 2
15+
16+
[*.js]
17+
indent_style = space
18+
indent_size = 2
19+
20+
[*.hbs]
21+
indent_style = space
22+
indent_size = 2
23+
24+
[*.css]
25+
indent_style = space
26+
indent_size = 2
27+
28+
[*.html]
29+
indent_style = space
30+
indent_size = 2
31+
32+
[*.{diff,md}]
33+
trim_trailing_whitespace = false

.ember-cli

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
/**
3+
Ember CLI sends analytics information by default. The data is completely
4+
anonymous, but there are times when you might want to disable this behavior.
5+
6+
Setting `disableAnalytics` to true will prevent any data from being sent.
7+
*/
8+
"disableAnalytics": false
9+
}

.gitignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
7+
# dependencies
8+
/node_modules
9+
/bower_components
10+
11+
# misc
12+
/.sass-cache
13+
/connect.lock
14+
/coverage/*
15+
/libpeerconnection.log
16+
npm-debug.log
17+
testem.log

.jshintrc

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"predef": [
3+
"document",
4+
"window",
5+
"-Promise"
6+
],
7+
"browser": true,
8+
"boss": true,
9+
"curly": true,
10+
"debug": false,
11+
"devel": true,
12+
"eqeqeq": true,
13+
"evil": true,
14+
"forin": false,
15+
"immed": false,
16+
"laxbreak": false,
17+
"newcap": true,
18+
"noarg": true,
19+
"noempty": false,
20+
"nonew": false,
21+
"nomen": false,
22+
"onevar": false,
23+
"plusplus": false,
24+
"regexp": false,
25+
"undef": true,
26+
"sub": true,
27+
"strict": false,
28+
"white": false,
29+
"eqnull": true,
30+
"esnext": true,
31+
"unused": true
32+
}

.travis.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
language: node_js
3+
4+
sudo: false
5+
6+
cache:
7+
directories:
8+
- node_modules
9+
10+
before_install:
11+
- "npm config set spin false"
12+
- "npm install -g npm@^2"
13+
14+
install:
15+
- npm install -g bower
16+
- npm install
17+
- bower install
18+
19+
script:
20+
- npm test

Brocfile.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
/* global require, module */
2+
3+
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
4+
5+
var app = new EmberApp();
6+
7+
// Use `app.import` to add additional libraries to the generated
8+
// output files.
9+
//
10+
// If you need to use different assets in different
11+
// environments, specify an object as the first parameter. That
12+
// object's keys should be the environment name and the values
13+
// should be the asset to use in that environment.
14+
//
15+
// If the library that you are including contains AMD or ES6
16+
// modules that you would like to import into your application
17+
// please specify an object with the list of modules as keys
18+
// along with the exports of each module as its value.
19+
20+
module.exports = app.toTree();

LICENSE.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6+
7+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# ember-scroll-to
2+
3+
Animated scrolling to a specified id.
4+
5+
## Installation
6+
7+
```bash
8+
# From within your ember-cli project
9+
ember install:addon ember-scroll-to
10+
```
11+
12+
## Usage
13+
14+
In your template:
15+
16+
```hbs
17+
{{scroll-to href='#faq' label='FAQ'}}
18+
{{!-- or --}}
19+
{{#scroll-to href='#faq'}}FAQ{{/scroll-to}}
20+
```

addon/components/scroll-to.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import Em from 'ember';
2+
3+
var DURATION = 750;
4+
5+
var EASING = 'swing';
6+
7+
export default Em.Component.extend({
8+
tagName: 'a',
9+
href: null,
10+
duration: DURATION,
11+
easing: EASING,
12+
attributeBindings: ['href'],
13+
14+
scrollable: function() {
15+
return Em.$('html, body');
16+
}.property(),
17+
18+
target: function() {
19+
return Em.$(this.get('href')).offset().top;
20+
}.property('href'),
21+
22+
scroll: function(evt) {
23+
evt.stopPropagation();
24+
evt.preventDefault();
25+
26+
this.get('scrollable').animate({
27+
scrollTop: this.get('target')
28+
}, this.get('duration'), this.get('easing'));
29+
}.on('click')
30+
});

0 commit comments

Comments
 (0)