|
34 | 34 | ngIntroOnbeforechange: '=',
|
35 | 35 | ngIntroOnafterchange: '=',
|
36 | 36 | ngIntroAutostart: '=',
|
37 |
| - ngIntroAutorefresh: '=' |
| 37 | + ngIntroAutorefresh: '=', |
| 38 | + |
| 39 | + ngIntroHintsMethod: "=?", |
| 40 | + ngIntroOnhintsadded: "=", |
| 41 | + ngIntroOnhintsclicked: "=?", |
| 42 | + ngIntroOnhintclose: "=?", |
| 43 | + ngIntroShowHint: "=?", |
| 44 | + ngIntroShowHints: "=?", |
| 45 | + ngIntroHideHint: "=?", |
| 46 | + ngIntroHideHints: "=?" |
38 | 47 | },
|
39 | 48 | link: function(scope, element, attrs) {
|
40 | 49 |
|
|
111 | 120 | }
|
112 | 121 | };
|
113 | 122 |
|
| 123 | + scope.ngIntroHintsMethod = function() { |
| 124 | + if (typeof(introJs) !== 'function') { |
| 125 | + throw new IntroJsNotAvailable(); |
| 126 | + } |
| 127 | + |
| 128 | + navigationWatch = scope.$on('$locationChangeStart', function(){ |
| 129 | + intro.exit(); |
| 130 | + }); |
| 131 | + |
| 132 | + if (typeof(step) === 'string') { |
| 133 | + intro = introJs(step); |
| 134 | + |
| 135 | + } else { |
| 136 | + intro = introJs(); |
| 137 | + } |
| 138 | + |
| 139 | + intro.setOptions(scope.ngIntroOptions); |
| 140 | + |
| 141 | + if(scope.ngIntroOnhintsadded) { |
| 142 | + intro.onhintsadded(function() { |
| 143 | + scope.ngIntroOnhintsadded.call(this, scope); |
| 144 | + $timeout(function() {scope.$digest();}); |
| 145 | + }); |
| 146 | + } |
| 147 | + |
| 148 | + if(scope.ngIntroOnhintclick) { |
| 149 | + intro.onhintclick(function(hintElement, item, stepId) { |
| 150 | + scope.ngIntroOnhintclick.call(this, hintElement, hintElement, item, stepId, scope); |
| 151 | + $timeout(function() {scope.$digest();}); |
| 152 | + }); |
| 153 | + } |
| 154 | + |
| 155 | + if(scope.ngIntroOnhintclose) { |
| 156 | + intro.onhintclose(function (stepId) { |
| 157 | + scope.ngIntroOnhintclose.call(this, stepId, scope); |
| 158 | + $timeout(function() {scope.$digest();}); |
| 159 | + }); |
| 160 | + } |
| 161 | + |
| 162 | + intro.addHints(); |
| 163 | + }; |
| 164 | + |
114 | 165 | scope.ngIntroNextMethod = function () {
|
115 | 166 | intro.nextStep();
|
116 | 167 | };
|
|
130 | 181 | intro.refresh();
|
131 | 182 | };
|
132 | 183 |
|
| 184 | + scope.ngIntroShowHint = function(id) { |
| 185 | + intro.showHint(id); |
| 186 | + }; |
| 187 | + |
| 188 | + scope.ngIntroShowHints = function() { |
| 189 | + intro.showHints(); |
| 190 | + }; |
| 191 | + |
| 192 | + scope.ngIntroHideHint = function(id) { |
| 193 | + intro.hideHint(id); |
| 194 | + }; |
| 195 | + |
| 196 | + scope.ngIntroHideHints = function() { |
| 197 | + intro.hideHints(); |
| 198 | + }; |
| 199 | + |
133 | 200 | var autoStartWatch = scope.$watch('ngIntroAutostart', function () {
|
134 | 201 | if(scope.ngIntroAutostart){
|
135 | 202 | $timeout(function() {
|
|
0 commit comments