Skip to content

michalsnik/ember-cli-nouislider

 
 

Repository files navigation

ember-cli-nouislider

Build Status npm version Code Climate Ember Observer Score

This ember-cli addon provides you with a range-slider component, based on noUiSlider. It includes everything you need, and adds no extra dependencies other than noUiSlider itself (which has no external dependencies).

To get started simply install the addon:

$ ember install ember-cli-nouislider

(This addon supports Ember 1.13 and up. It might work on older versions, but this is guaranteed.)

This will install nouislider via Bower, and will include it into your application's mergetree, so you don't need to worry about anything there.

Demo & documentation

Have a look around then demo and documentation to get a feel for how to use it.

Component

You have the opportunity to customize if needed.

To do this, generate your own component and re-export the one provided:

$ ember g component range-slider
// app/components/range-slider.js
import RangeSlider from 'ember-cli-nouislider/components/range-slider';

export default RangeSlider;

Include the slider into your views like this:

{{range-slider start=someValue change="changedAction"}}

And setup an action handler in your route:

// app/routes/my-route.js
import Ember from 'ember';

export default Ember.Route.extend({
  // ...
  actions: {
    // ...
    changedAction: function(value) {
      Ember.debug( "New slider value: %@".fmt( value ) );
    }
  }
});

See the documentation for more actions.

Configuration

The component has a lot of configurable options, most of them mapping directly to the original options. To see how the slider is initialized internally, please have a look at app/components/range-slider.js in this project, or browse through the documentation.

Contributing or running locally

This section outlines the details of collaborating on this Ember addon.

Installing dependencies

  • git clone https://github.com/kennethkalmer/ember-cli-nouislider
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

About

{{range-slider}} component for ember-cli powered by noUiSlider

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • HTML 45.0%
  • JavaScript 32.2%
  • CSS 21.5%
  • Shell 1.3%