1.13.13 • Published 7 years ago

ember-cli-paint v1.13.13

Weekly downloads
34
License
MIT
Repository
github
Last release
7 years ago

Ember-cli-paint

Ember Observer Score

ember-cli-paint is an Ember addon that adds Paint components to your application.

More specifically it does two things:

  • Add core libraries to your project dependencies
app.import(path.join(app.bowerDirectory, 'paint/paint.scss'));
app.import(path.join(app.bowerDirectory, 'modernizr/modernizr.js'));
app.import(path.join(app.bowerDirectory, 'foundation/js/foundation/foundation.js'));

This means that after installing ember-cli-paint you'll be able to use paint css straight away.

  • Expose Ember components

Example: Tooltip Component

npm.io

export default Ember.Component.extend({
  classNameBindings: [':has-tip', 'tooltipPositionClass'],
  attributeBindings: ['ariaHaspopup:aria-haspopup', 'dataTooltip:data-tooltip', 'title'],

  ariaHaspopup: 'true',
  dataTooltip: '',
  tooltipPosition: 'bottom',

  tooltipPositionClass: function() {
    return `tip-${this.get('tooltipPosition')}`;
  }.property('tooltipPosition'),

  onDidInsertElement: function() {
    Ember.$(document).foundation({ tooltip: {} });
  }.on('didInsertElement')
});

You can extend the component in your project like so:

import Ember from 'ember';
import AsTooltip from 'ember-cli-paint/components/as-tooltip';

export default AsTooltip.extend({
  classNameBindings: [':avatar'],
  attributeBindings: ['src', 'alt', 'title'],
  tagName: 'img',
  tooltipPosition: 'top',

  user: null,
  alt: Ember.computed.alias('user.initials'),
  src: Ember.computed.alias('user.avatarUrl'),
  title: Ember.computed.alias('user.name')
});

And use it in templates

...
{{as-avatar user=lead class="lead"}}
...

You can also use it directly

{{#as-tooltip title="This will be in the tooltip"}}
  <img src="blabla"></img>
{{/as-tooltip}}

Creating your own component

Check out the documentation regarding addons at http://ember-cli.com. This blog post documents some of the hooks you can leverage in ember addons.

If you have added a new Paint component remember to bump its version in bower.json and in blueprints index.js

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

Publishing the package

  • Merge your PR on GitHub
  • git checkout master
  • git pull
  • Bump package version (e.g. npm version patch)
  • npm publish
  • git push --tags

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

1.13.13

7 years ago

1.13.12

7 years ago

1.13.11

8 years ago

1.13.10

8 years ago

1.13.9

8 years ago

1.13.8

8 years ago

1.13.7

8 years ago

1.13.6

8 years ago

1.13.5

8 years ago

1.13.4

8 years ago

1.13.3

8 years ago

1.13.2

8 years ago

1.13.1

9 years ago

1.13.0

9 years ago

1.12.9

9 years ago

1.12.8

9 years ago

1.12.7

9 years ago

1.12.6

9 years ago

1.12.5

9 years ago

1.12.4

9 years ago

1.12.3

9 years ago

1.12.2

9 years ago

1.12.1

9 years ago

1.12.0

9 years ago

1.11.7

9 years ago

1.11.6

9 years ago

1.11.5

9 years ago

1.11.4

9 years ago

1.11.3

9 years ago

1.11.2

9 years ago

1.11.1

9 years ago

1.11.0

9 years ago

1.10.8

9 years ago

1.10.7

9 years ago

1.10.6

9 years ago

1.10.5

9 years ago

1.10.4

9 years ago

1.10.3

9 years ago

1.10.2

9 years ago

1.10.1

9 years ago

1.10.0

9 years ago

1.9.0

9 years ago

1.8.24

9 years ago

1.8.23

9 years ago

1.8.22

9 years ago

1.8.21

9 years ago

1.8.20

9 years ago

1.8.19

9 years ago

1.8.18

9 years ago

1.8.17

9 years ago

1.8.16

9 years ago

1.8.15

9 years ago

1.8.14

9 years ago

1.8.13

9 years ago

1.8.12

9 years ago

1.8.11

9 years ago

1.8.10

9 years ago

1.8.9

9 years ago

1.8.8

9 years ago

1.8.7

9 years ago

1.8.6

9 years ago

1.8.5

9 years ago

1.8.4

9 years ago

1.8.3

9 years ago

1.8.2

9 years ago

1.8.1

9 years ago

1.8.0

9 years ago

1.7.1

9 years ago

1.6.1

9 years ago

1.6.0

9 years ago

1.5.0

9 years ago

1.4.1

9 years ago

1.4.0

9 years ago

1.3.1

9 years ago

1.3.0

9 years ago

1.2.2

9 years ago

1.2.1

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.0

10 years ago