Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken headings in Markdown files #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ember-hammer is a neat interface for defining [Hammer.js](https://github.com/Eig

Note: Hammer.js 2.x support is currently experimental.

##Example
## Example

```javascript
/* ES6 Modules Example */
Expand Down Expand Up @@ -36,9 +36,9 @@ App.SomeComponent = Ember.Component.extend({
});
```

##Usage
## Usage

###With ember-cli
### With ember-cli

In your project directory (generated by ember-cli), run the following commands in your terminal:

Expand All @@ -52,11 +52,11 @@ In your `Brocfile.js` (which should be in the root of your project directory), b

That should be it. You'll now be able to define a `gestures` object in your components.

###With globals
### With globals

First, include the `ember-hammer.js` file into your asset delivery pipeline (ideally this should include minification, concatenation and gzipping facilities). ember-hammer should be included after Ember.js and Hammer.js.

###Once included
### Once included

Next, define a `gestures` object in any component that you'd like to enable gestural behaviour for. Inside this object, define any Hammer.js gestural event name as a key, with the callback function to be executed as the value.

Expand All @@ -74,23 +74,23 @@ gestures: {

See the full example at the top of the README.

###Passing options to Hammer.js
### Passing options to Hammer.js

You can optionally define a `hammerOptions` object inside your component to specify any specific options that should be passed into Hammer.js. Options defined inside the `hammerOptions` object are specific to that component.

If you'd like to set global options for all instances of Hammer.js (applicable to all components), you can use `emberHammerOptions.hammerOptions`. See the section on emberHammerOptions below.

###Event Callback Function
### Event Callback Function

The callback function is passed a single `event` argument, which is provided by Hammer.js.

The `this` context of the callback will be set to the component object, so you can access any methods on the component that you may need to get the desired behaviour.

###Event bubbling
### Event bubbling

Gestural events bubble up the DOM tree, so if you'd like to catch an event and cancel bubbling, just return `false` from your callback.

###Ember.EventDispatcher
### Ember.EventDispatcher

Assuming you'll be using ember-hammer (and therefore Hammer.js) to manage touch-based gestural behaviour in your application, there is no point in having Ember's EventDispatcher listen to touch events. By default, ember-hammer will prevent EventDispatcher from listening to the following touch events:

Expand All @@ -103,11 +103,11 @@ This brings a significant performance benefit.

You can modify this behaviour by setting `emberHammerOptions.ignoreEvents` to an array of event names EventDispatcher shouldn't bind to. Set this option to an empty array to disable this behaviour.

####ember-fastclick
#### ember-fastclick

If you are using ember-hammer with ember-fastclick, you will need to disable this behaviour by setting `emberHammerOptions.ignoreEvents` to an empty array. ** E.g. `window.emberHammerOptions = { ignoreEvents: [] };`

###Setting emberHammerOptions (settings / global options)
### Setting emberHammerOptions (settings / global options)

You can set the global options for ember-hammer by defining an object called `emberHammerOptions` on the `window` object. It is important that the object is defined **before** `ember-hammer.js` is loaded. A suitable place might be in an inline script tag in the head section of your document.

Expand All @@ -124,6 +124,6 @@ window.emberHammerOptions = {

`emberHammerOptions.hammerOptions` will be passed into every instance of Hammer.js. You can override these options and set additional ones for a specific `Ember.Component` by setting the `hammerOptions` key inside the component object. See the relevant section above for more information.

##License
## License

Please see the `LICENSE` file for more information.