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

Update README.md #17

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
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ That's it! Enjoy the plugin!

Configuration
-------------
The directive itself takes as a parameter callback function, that returns promise after execution. If function returns value progress completes instantly.
The directive itself is taken as a parameter callback function, that returns promise after execution. If function returns value progress completes instantly.
You can configure plugin using two different ways:
* Using html attributes
* Using javascript
Expand All @@ -41,11 +41,11 @@ Here is a list of supported HTML attributes and their meaning:
|---|---|---------|
| pb-style | <ul><li>fill</li><li>shrink</li><li>rotate-angle-bottom</li><li>rotate-angle-top</li><li>rotate-angle-left</li><li>rotate-angle-right</li><li>rotate-side-down</li><li>rotate-side-up</li><li>rotate-side-left</li><li>rotate-side-right</li><li>rotate-back</li><li>slide-down</li><li>top-line</li><li>move-up</li><li>lateral-lines</li><li>flip-open</li></ul> | Defines button appearance. Default value is <b>fill</b>. |
| pb-direction | <ul><li>horizontal</li><li>vertical</li></ul> | To be used with pb-style=(fill or shrink). Defines the direction of the progress bar.<br/> Default value is <b>horizontal</b>. |
| pb-random-progress | <ul><li>true</li><li>false</li></ul> | Runs random fill function from the moment button is clicked till promise is resolved.<br/> Default value is <b>true</b>. |
| pb-random-progress | <ul><li>true</li><li>false</li></ul> | Runs random fill function from the moment button is clicked until promise is resolved.<br/> Default value is <b>true</b>. |
| pb-profile | _String value_ | The profile from which to fetch configuration during the button initialization.<br/> For more information look JS configuration section |

##### Javascript configuration
For those ones, who don't like to have a lot of configuration in HTML as well to prevent the copy-paste there also is possibility to define configuration in Javascript using profiles.
For those ones, who don't like neither to have a lot of configuration in HTML nor to prevent the copy-paste, there also is a possibility to define configuration in Javascript using profiles.
To do this, you need to inject `progressButtonConfigProvider` during the app configuration:
```javascript
mdl.config(function(progressButtonConfigProvider) {
Expand All @@ -55,13 +55,13 @@ mdl.config(function(progressButtonConfigProvider) {
});
});
```
In this example new profile called 'testProfile' created. You can then apply it to you button like this:
In this example new profile called 'testProfile' created. Afterwards you can apply it to your button like this:
```html
<button progress-button="someFunctionThatReturnsPromise()" pb-profile="testProfile">Submit</button>
```
This would create new button with style _shrink_ and _vertical_ direction.
This would create a new button in style _shrink_ and _vertical_ direction.

You can as well define <b>default profile</b>, that will be applied to all the buttons across your application:
You can also define <b>default profile</b>, that will be applied to all the buttons across your application:
```javascript
progressButtonConfigProvider.profile({
style: 'shrink',
Expand Down