Skip to content

Commit

Permalink
Merge pull request #30 from bignall/caret-hover
Browse files Browse the repository at this point in the history
Add caret and hover-text options
  • Loading branch information
jshor committed Oct 7, 2016
2 parents 1844e91 + 124bc3d commit cbe2b46
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ For a demo, please [click here](http://jshor.github.io/angular-addtocalendar/dem
| `class-name` | The desired class for the dropdown. See [styling](). | Bootstrap class/plain text. Default `btn btn-sm btn-default dropdown-toggle` | btn btn-sm btn-default dropdown-toggle | No |
| `btn-text` | Text for the button to display | Plain text. Default `Add to calendar` | Add to calendar | No |
| `uib-dropdown` | Whether to use ui-bootstrap dropdown | `null` Default `Add to calendar` | `null` | No |
| `caret` | Whether to use the caret. | String interpreted as boolean Default: `true` | false | No |
| `hover-text` | Text to use as the title of the element. | String Default: value of title attribute | Add to calendar | No |

# Styling

Expand Down
10 changes: 7 additions & 3 deletions addtocalendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,13 @@ addtocalendar

function getTemplate(prefix) {
return '\
<div class="btn-group dropdown" ' + prefix + ' on-toggle="toggled(open)">\
<div class="btn-group dropdown" ' + prefix + ' on-toggle="toggled(open)" \
title="{{(hoverText == undefined) ? title : hoverText}}">\
<span\
ng-class="className || \'btn btn-sm btn-default ' + prefix + '-toggle\'"\
' + prefix + '-toggle>\
{{(btnText == undefined) ? \'Add to calendar\' : btnText}} <span class="caret"></span>\
{{(btnText == undefined) ? \'Add to calendar\' : btnText}}\
<span ng-if="caret != \'false\'" class="caret"></span>\
</span>\
<ul class="dropdown-menu">\
<li><a ng-click="calendarUrl.dlIcal()" ng-if="calendarUrl.dlIcal">iCalendar</a></li>\
Expand Down Expand Up @@ -246,7 +248,9 @@ addtocalendar
description: '@',
location: '@',
className: '@',
btnText: '@'
btnText: '@',
caret: '@',
hoverText: '@'
},
controller: 'AddtocalendarCtrl',
template: resolveTemplate
Expand Down
2 changes: 1 addition & 1 deletion addtocalendar.min.js

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

10 changes: 7 additions & 3 deletions addtocalendar/directive.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@ addtocalendar

function getTemplate(prefix) {
return '\
<div class="btn-group dropdown" ' + prefix + ' on-toggle="toggled(open)">\
<div class="btn-group dropdown" ' + prefix + ' on-toggle="toggled(open)" \
title="{{(hoverText == undefined) ? title : hoverText}}">\
<span\
ng-class="className || \'btn btn-sm btn-default ' + prefix + '-toggle\'"\
' + prefix + '-toggle>\
{{(btnText == undefined) ? \'Add to calendar\' : btnText}} <span class="caret"></span>\
{{(btnText == undefined) ? \'Add to calendar\' : btnText}}\
<span ng-if="caret != \'false\'" class="caret"></span>\
</span>\
<ul class="dropdown-menu">\
<li><a ng-click="calendarUrl.dlIcal()" ng-if="calendarUrl.dlIcal">iCalendar</a></li>\
Expand Down Expand Up @@ -43,7 +45,9 @@ addtocalendar
description: '@',
location: '@',
className: '@',
btnText: '@'
btnText: '@',
caret: '@',
hoverText: '@'
},
controller: 'AddtocalendarCtrl',
template: resolveTemplate
Expand Down

0 comments on commit cbe2b46

Please sign in to comment.