Skip to content

Simplifying toggling carets and other icons

License

Notifications You must be signed in to change notification settings

alexander-alvarez/ember-toggle-it

Repository files navigation

ember-toggle-it

Sick of having CSS classes sprinkled everywhere just to rotate an icon? Wish it could be more declarative to implement? ember-toggle-it will help you easily toggle it.

Doesn't interfere with your DOM. Currently works with centered elements.

Installation

ember install ember-toggle-it

Usage

Supports Several Toggle Modes

Up-Down

{{#toggle-it toggleMode='^-v' value=value as |t| }}
   <a onclick={{action t.toggle}}>Icon </a>
{{/toggle-it}}

Left-Right (will be inverted in rtl mode)

{{#toggle-it toggleMode='<->' value=value as |t| }}
   <a onclick={{action t.toggle}}>Icon </a>
{{/toggle-it}}

Left-Down (will be right-down in rtl-mode)

{{#toggle-it toggleMode='<-v' value=value as |t| }}
   <a onclick={{action t.toggle}}>Icon </a>
{{/toggle-it}}

Supports DDAU

{{#toggle-it value=value update=(action (mut value)) as |t|}}
   <a onclick={{action t.toggle}}>Icon </a>
{{/toggle-it}}

Supports RTL

{{#toggle-it rtl=true value=value as |t| }}
   <a onclick={{action t.toggle}}>Icon </a>
{{/toggle-it}}

Contributing

  • git clone alexander-alvarez/ember-toggle-it this repository
  • cd ember-toggle-it
  • npm install
  • bower install

Running

Running Tests

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

Building

  • ember build

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

About

Simplifying toggling carets and other icons

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published