Skip to content

Commit

Permalink
Merge pull request #59 from fitcode/title_element
Browse files Browse the repository at this point in the history
adding a title to the tour bubble
  • Loading branch information
booleanbetrayal committed Dec 11, 2015
2 parents 684f317 + 6d18561 commit 0dbaea9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 13 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ There are additional attributes that allow you to customize each tour-tip.

* `tourtip-container-element` **(Default: "body")**: Element the tour tips are placed in. Especially practical when you have several scrollable containers you want to display tours in.

* `tourtip-title` **(Default: null)**: Title creates a separate h3 element to allow the separation of a title and it's content.

Inside your tour, you also have access to two scope methods for ending and starting the tour.

```HTML
Expand Down
8 changes: 6 additions & 2 deletions dist/angular-tour-tpls.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* An AngularJS directive for showcasing features of your website
* @version v0.2.5 - 2015-11-05
* @version v0.2.5 - 2015-12-10
* @link https://github.com/DaftMonk/angular-tour
* @author Tyler Henkel
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand All @@ -16,7 +16,7 @@
angular.module('tour/tour.tpl.html', []).run([
'$templateCache',
function ($templateCache) {
$templateCache.put('tour/tour.tpl.html', '<div class="tour-tip">\n' + ' <span class="tour-arrow tt-{{ ttPlacement }}" ng-hide="centered"></span>\n' + ' <div class="tour-content-wrapper">\n' + ' <p ng-bind="ttContent"></p>\n' + ' <a ng-click="proceed()" ng-bind="ttNextLabel" class="small button tour-next-tip"></a>\n' + ' <a ng-click="closeTour()" class="tour-close-tip">&times;</a>\n' + ' </div>\n' + '</div>');
$templateCache.put('tour/tour.tpl.html', '<div class="tour-tip">\n' + ' <span class="tour-arrow tt-{{ ttPlacement }}" ng-hide="centered"></span>\n' + ' <div class="tour-content-wrapper">\n' + ' <h3 ng-bind="ttTitle"></h3>\n' + ' <p ng-bind="ttContent"></p>\n' + ' <a ng-click="proceed()" ng-bind="ttNextLabel" class="small button tour-next-tip"></a>\n' + ' <a ng-click="closeTour()" class="tour-close-tip">&times;</a>\n' + ' </div>\n' + '</div>\n' + '');
}
]);
angular.module('angular-tour.tour', []).constant('tourConfig', {
Expand Down Expand Up @@ -200,6 +200,10 @@
attrs.$observe('tourtipElement', function (val) {
scope.ttElement = val || null;
});
//defaults: null
attrs.$observe('tourtipTitle', function (val) {
scope.ttTitle = val || null;
});
//defaults: tourConfig.useSourceScope
attrs.$observe('useSourceScope', function (val) {
scope.ttSourceScope = !val ? tourConfig.useSourceScope : val === 'true';
Expand Down
2 changes: 1 addition & 1 deletion dist/angular-tour-tpls.min.js

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

6 changes: 5 additions & 1 deletion dist/angular-tour.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* An AngularJS directive for showcasing features of your website
* @version v0.2.5 - 2015-11-05
* @version v0.2.5 - 2015-12-10
* @link https://github.com/DaftMonk/angular-tour
* @author Tyler Henkel
* @license MIT License, http://www.opensource.org/licenses/MIT
Expand Down Expand Up @@ -190,6 +190,10 @@
attrs.$observe('tourtipElement', function (val) {
scope.ttElement = val || null;
});
//defaults: null
attrs.$observe('tourtipTitle', function (val) {
scope.ttTitle = val || null;
});
//defaults: tourConfig.useSourceScope
attrs.$observe('useSourceScope', function (val) {
scope.ttSourceScope = !val ? tourConfig.useSourceScope : val === 'true';
Expand Down
Loading

0 comments on commit 0dbaea9

Please sign in to comment.