Skip to content

additional options (backdrop, keyboard), dropdown fix #26

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions angular-prompt.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ <h4 class="modal-title">{{options.title}}</h4>
<div class="input-group" ng-if="options.values">
<input id="cgPromptInput" type="text" class="form-control" placeholder="{{options.label}}" ng-model="input.name" required ng-change="changed=true" autofocus="autofocus"/>

<div class="input-group-btn" dropdown>
<button type="button" class="btn btn-default dropdown-toggle" dropdown-toggle data-toggle="dropdown"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right">
<div class="input-group-btn" uib-dropdown>
<button type="button" class="btn btn-default dropdown-toggle" uib-dropdown-toggle data-toggle="dropdown"><span class="caret"></span></button>
<ul class="dropdown-menu pull-right" uib-dropdown-menu>
<li ng-repeat="value in options.values"><a href="" ng-click="input.name = value">{{value}}</a></li>
</ul>
</div>
Expand Down
4 changes: 4 additions & 0 deletions angular-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ angular.module('cgPrompt').factory('prompt',['$uibModal','$q',function($uibModal
input: false,
label: '',
value: '',
backdrop: true,
keyboard: true,
values: false,
buttons: [
{label:'Cancel',cancel:true},
Expand All @@ -32,6 +34,8 @@ angular.module('cgPrompt').factory('prompt',['$uibModal','$q',function($uibModal
$uibModal.open({
templateUrl:'angular-prompt.html',
controller: 'cgPromptCtrl',
backdrop: options.backdrop,
keyboard: options.keyboard,
resolve: {
options:function(){
return options;
Expand Down
3 changes: 2 additions & 1 deletion demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ angular.module('app').controller('DemoCtrl',function($scope,prompt){
label:'Input label',
value:'Input initial value',
values:'',
buttons:''
buttons:'',
keyboard: true
};

var processOptions = function(){
Expand Down
9 changes: 9 additions & 0 deletions demo/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ <h4>Options</h4>
<input type="text" class="form-control" id="message" placeholder="Message" ng-model="options.message">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label>
<input type="checkbox" ng-model="options.keyboard"> Keyboard
</label>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
Expand Down
10 changes: 7 additions & 3 deletions dist/angular-prompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ angular.module('cgPrompt').factory('prompt',['$uibModal','$q',function($uibModal
input: false,
label: '',
value: '',
backdrop: true,
keyboard: true,
values: false,
buttons: [
{label:'Cancel',cancel:true},
Expand All @@ -32,6 +34,8 @@ angular.module('cgPrompt').factory('prompt',['$uibModal','$q',function($uibModal
$uibModal.open({
templateUrl:'angular-prompt.html',
controller: 'cgPromptCtrl',
backdrop: options.backdrop,
keyboard: options.keyboard,
resolve: {
options:function(){
return options;
Expand Down Expand Up @@ -124,9 +128,9 @@ angular.module('cgPrompt').run(['$templateCache', function($templateCache) {
" <div class=\"input-group\" ng-if=\"options.values\">\n" +
" <input id=\"cgPromptInput\" type=\"text\" class=\"form-control\" placeholder=\"{{options.label}}\" ng-model=\"input.name\" required ng-change=\"changed=true\" autofocus=\"autofocus\"/>\n" +
"\n" +
" <div class=\"input-group-btn\" dropdown>\n" +
" <button type=\"button\" class=\"btn btn-default dropdown-toggle\" dropdown-toggle data-toggle=\"dropdown\"><span class=\"caret\"></span></button>\n" +
" <ul class=\"dropdown-menu pull-right\">\n" +
" <div class=\"input-group-btn\" uib-dropdown>\n" +
" <button type=\"button\" class=\"btn btn-default dropdown-toggle\" uib-dropdown-toggle data-toggle=\"dropdown\"><span class=\"caret\"></span></button>\n" +
" <ul class=\"dropdown-menu pull-right\" uib-dropdown-menu>\n" +
" <li ng-repeat=\"value in options.values\"><a href=\"\" ng-click=\"input.name = value\">{{value}}</a></li>\n" +
" </ul>\n" +
" </div>\n" +
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.