Skip to content

Commit

Permalink
added class options to buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
cgross committed Jul 6, 2014
1 parent 4bf201f commit 1c9ca09
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ function MyCtrl($scope, prompt) {
A list of values available in a dropdown for the user to select as the input value.

- #### options.buttons
Type: `Array` of `Object` with properties `label`,`cancel`, and `primary`
Type: `Array` of `Object` with properties `label`,`cancel`, `class`, and `primary`
Default: `[{ label:'OK', primary: true }, { label:'Cancel', cancel: true }]`
A list of the buttons to display on the dialog.

The function returns a promise. That promise is resolved with either the button that was pressed, or in the case of input prompts, the value the user entered. If the user pressed a button where `cancel=true` or canceled the dialog another way (hit ESC, etc) then the promise is rejected.

## Release History
* v1.1.0
* Added `class` option to buttons.
* v1.0.1
* Updated modal template with correct modal title class.
* Added bower_components to ignore in bower.json.
Expand Down
2 changes: 1 addition & 1 deletion angular-prompt.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ <h4 class="modal-title">{{options.title}}</h4>

</div>
<div class="modal-footer">
<button ng-repeat="button in options.buttons track by button.label" class="btn btn-default" ng-class="{'btn-primary':button.primary}" ng-click="buttonClicked(button)">{{button.label}}</button>
<button ng-repeat="button in options.buttons track by button.label" class="btn btn-default {{button.class}}" ng-class="{'btn-primary':button.primary}" ng-click="buttonClicked(button)">{{button.label}}</button>
</div>
</div>
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "angular-prompt",
"description": "Angular service to easily display prompt and confirmation modals.",
"version": "1.0.2",
"version": "1.1.0",
"main": [
"dist/angular-prompt.js"
],
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ angular.module('cgPrompt').run(['$templateCache', function($templateCache) {
"\n" +
" </div>\n" +
" <div class=\"modal-footer\">\n" +
" <button ng-repeat=\"button in options.buttons track by button.label\" class=\"btn btn-default\" ng-class=\"{'btn-primary':button.primary}\" ng-click=\"buttonClicked(button)\">{{button.label}}</button>\n" +
" <button ng-repeat=\"button in options.buttons track by button.label\" class=\"btn btn-default {{button.style}}\" ng-class=\"{'btn-primary':button.primary}\" ng-click=\"buttonClicked(button)\">{{button.label}}</button>\n" +
" </div>\n" +
"</div>"
);
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-prompt.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-prompt",
"version": "1.0.2",
"version": "1.1.0",
"description": "",
"repository": {
"type": "git",
Expand Down

0 comments on commit 1c9ca09

Please sign in to comment.