0.1.0 • Published 9 years ago

ember-expand-on-focus v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Ember-expand-on-focus

This is a bare-bones, highly customizable UI component for interaction through focus-in and focus-out events. If the component is in the expanded state, a class named 'expanded' is added to it.

#Usage

{{#expander-on-focus}}

  ..... (your content).....

{{/expander-on-focus}}

#What it does:

  • Clicking anywhere outside the component removes the class 'expanded', if it is present.

  • As a special case you can specify a class of an element outside the component which you can click to remove the 'expanded' class from the component. This way, the component will shrink only when you click on that element, not anywhere outside the component. Usage:

  {{#expander-on-focus focusOutTriggerClass="someClass"}}
  ..... (your content) .....
  {{/expander-on-focus}}
  • Clicking within the component involves 2 cases:

    1. Clicking on an element with the class 'force-shrink' removes the 'expanded' class of the component. This can be used for close buttons within the component.

    2. Clicking anywhere else within the component adds the class 'expanded', if it is not already present

  • Also, you can bind the expanded property to a property of the surrounding context. Please note that both are boolean properties.
{{#expander-on-focus expanded=isExpanded}}
..... (your content) .....
{{/expander-on-focus}}

Demo

A live demo is at https://expand-on-focus-demo.herokuapp.com/

0.1.0

9 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago