-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4afa2ef
commit 01b4c16
Showing
11 changed files
with
70 additions
and
51 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 |
---|---|---|
|
@@ -14,6 +14,9 @@ module.exports = { | |
env: { | ||
browser: true | ||
}, | ||
globals: { | ||
'FastClick': true | ||
}, | ||
rules: { | ||
}, | ||
overrides: [ | ||
|
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,50 +1,14 @@ | ||
ember-cli-fastclick | ||
============================================================================== | ||
# Ember CLI FastClick | ||
|
||
[Short description of the addon.] | ||
Drop-in FastClick support for Ember CLI apps. | ||
|
||
Installation | ||
------------------------------------------------------------------------------ | ||
For more information on FastClick visit http://ftlabs.github.io/fastclick. | ||
|
||
``` | ||
ember install ember-cli-fastclick | ||
``` | ||
## Installation | ||
|
||
This is addon is installed in one simple step: | ||
|
||
Usage | ||
------------------------------------------------------------------------------ | ||
ember install ember-cli-fastclick | ||
|
||
[Longer description of how to use the addon in apps.] | ||
|
||
|
||
Contributing | ||
------------------------------------------------------------------------------ | ||
|
||
### Installation | ||
|
||
* `git clone <repository-url>` | ||
* `cd ember-cli-fastclick` | ||
* `yarn install` | ||
|
||
### Linting | ||
|
||
* `yarn lint:js` | ||
* `yarn lint:js --fix` | ||
|
||
### Running tests | ||
|
||
* `ember test` – Runs the test suite on the current Ember version | ||
* `ember test --server` – Runs the test suite in "watch mode" | ||
* `ember try:each` – Runs the test suite against multiple Ember versions | ||
|
||
### Running the dummy application | ||
|
||
* `ember serve` | ||
* Visit the dummy application at [http://localhost:4200](http://localhost:4200). | ||
|
||
For more information on using ember-cli, visit [https://ember-cli.com/](https://ember-cli.com/). | ||
|
||
License | ||
------------------------------------------------------------------------------ | ||
|
||
This project is licensed under the [MIT License](LICENSE.md). | ||
When you now access your app from a mobile device you should see that the 300ms | ||
touch delay was removed and the app feels more like a native app. |
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,11 @@ | ||
import { schedule } from '@ember/runloop'; | ||
|
||
export function initialize() { | ||
schedule('afterRender', function() { | ||
FastClick.attach('body'); | ||
}); | ||
} | ||
|
||
export default { | ||
initialize | ||
}; |
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 @@ | ||
export { default, initialize } from 'ember-cli-fastclick/initializers/fastclick'; |
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,5 +1,10 @@ | ||
'use strict'; | ||
|
||
module.exports = { | ||
name: 'ember-cli-fastclick' | ||
name: 'ember-cli-fastclick', | ||
|
||
included(app) { | ||
this._super.included(app); | ||
app.import('node_modules/fastclick/lib/fastclick.js'); | ||
} | ||
}; |
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 @@ | ||
{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]} |
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,9 +1,9 @@ | ||
import Ember from 'ember'; | ||
import Route from '@ember/routing/route'; | ||
|
||
export default Ember.Route.extend({ | ||
export default Route.extend({ | ||
actions: { | ||
logClick() { | ||
window.console.log('Clicked'); | ||
} | ||
} | ||
}); | ||
}) |
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,5 +1,3 @@ | ||
<button type="button" name="button" {{action 'logClick'}}> | ||
Click me! | ||
</button> | ||
|
||
{{outlet}} |
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,31 @@ | ||
import Application from '@ember/application'; | ||
|
||
import { initialize } from 'dummy/initializers/fastclick'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
import { run } from '@ember/runloop'; | ||
|
||
module('Unit | Initializer | fastclick', function(hooks) { | ||
setupTest(hooks); | ||
|
||
hooks.beforeEach(function() { | ||
this.TestApplication = Application.extend(); | ||
this.TestApplication.initializer({ | ||
name: 'initializer under test', | ||
initialize | ||
}); | ||
|
||
this.application = this.TestApplication.create({ autoboot: false }); | ||
}); | ||
|
||
hooks.afterEach(function() { | ||
run(this.application, 'destroy'); | ||
}); | ||
|
||
// Replace this with your real tests. | ||
test('it works', async function(assert) { | ||
await this.application.boot(); | ||
|
||
assert.ok(true); | ||
}); | ||
}); |
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