Skip to content

Commit 1c9ca09

Browse files
committed
added class options to buttons
1 parent 4bf201f commit 1c9ca09

6 files changed

+8
-6
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ function MyCtrl($scope, prompt) {
8585
A list of values available in a dropdown for the user to select as the input value.
8686

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

9292
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.
9393

9494
## Release History
95+
* v1.1.0
96+
* Added `class` option to buttons.
9597
* v1.0.1
9698
* Updated modal template with correct modal title class.
9799
* Added bower_components to ignore in bower.json.

angular-prompt.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,6 @@ <h4 class="modal-title">{{options.title}}</h4>
2828

2929
</div>
3030
<div class="modal-footer">
31-
<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>
31+
<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>
3232
</div>
3333
</div>

bower.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "angular-prompt",
33
"description": "Angular service to easily display prompt and confirmation modals.",
4-
"version": "1.0.2",
4+
"version": "1.1.0",
55
"main": [
66
"dist/angular-prompt.js"
77
],

dist/angular-prompt.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ angular.module('cgPrompt').run(['$templateCache', function($templateCache) {
134134
"\n" +
135135
" </div>\n" +
136136
" <div class=\"modal-footer\">\n" +
137-
" <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" +
137+
" <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" +
138138
" </div>\n" +
139139
"</div>"
140140
);

dist/angular-prompt.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "angular-prompt",
3-
"version": "1.0.2",
3+
"version": "1.1.0",
44
"description": "",
55
"repository": {
66
"type": "git",

0 commit comments

Comments
 (0)