|
79 | 79 | that.clear = function() {
|
80 | 80 | var $nextBtn = $(".enjoyhint_next_btn");
|
81 | 81 | var $skipBtn = $(".enjoyhint_skip_btn");
|
82 |
| - |
| 82 | + var $prevBtn = $(".enjoyhint_prev_btn"); |
| 83 | + |
| 84 | + $prevBtn.removeClass(that.prevUserClass); |
83 | 85 | $nextBtn.removeClass(that.nextUserClass);
|
84 | 86 | $nextBtn.text(BTN_NEXT_TEXT);
|
85 | 87 | $skipBtn.removeClass(that.skipUserClass);
|
|
209 | 211 | $nextBtn.text(step_data.nextButton.text || "Next");
|
210 | 212 | that.nextUserClass = step_data.nextButton.className;
|
211 | 213 | }
|
212 |
| - |
| 214 | + |
| 215 | + if (step_data.prevButton) { |
| 216 | + var $prevBtn = $(".enjoyhint_prev_btn"); |
| 217 | + |
| 218 | + $prevBtn.addClass(step_data.prevButton.className || ""); |
| 219 | + $prevBtn.text(step_data.prevButton.text || "Previous"); |
| 220 | + that.prevUserClass = step_data.prevButton.className; |
| 221 | + } |
| 222 | + |
213 | 223 | if (step_data.skipButton) {
|
214 | 224 | var $skipBtn = $(".enjoyhint_skip_btn");
|
215 | 225 |
|
|
285 | 295 | scroll: step_data.scroll
|
286 | 296 | };
|
287 | 297 |
|
288 |
| - if (step_data.nextButton) { |
289 |
| - shape_data.nextBtnInitValue = step_data.nextButton.text |
| 298 | + var customBtnProps = { |
| 299 | + nextButton: step_data.nextButton, |
| 300 | + prevButton: step_data.prevButton |
290 | 301 | }
|
291 | 302 |
|
292 | 303 | if (shape_data.center_x === 0 && shape_data.center_y === 0) {
|
|
304 | 315 | shape_data.height = h + shape_margin;
|
305 | 316 | }
|
306 | 317 |
|
307 |
| - $body.enjoyhint("render_label_with_shape", shape_data, that.stop); |
| 318 | + $body.enjoyhint("render_label_with_shape", shape_data, that.stop, customBtnProps); |
308 | 319 |
|
309 | 320 | }, scrollSpeed + 20 || 270);
|
310 | 321 | }, timeout);
|
|
748 | 759 | that.stepData.width = newDataCoords.width + 11;
|
749 | 760 | that.stepData.height = newDataCoords.height + 11;
|
750 | 761 |
|
751 |
| - that.renderLabelWithShape(that.stepData); |
| 762 | + that.renderLabelWithShape(that.stepData, that.customBtnProps); |
752 | 763 | $('.enjoyhint_next_btn').css('visibility', 'visible');
|
753 | 764 | $('.enjoyhint_prev_btn').css('visibility', 'visible');
|
754 | 765 | $('.enjoyhint_skip_btn').css('visibility', 'visible');
|
|
1128 | 1139 | };
|
1129 | 1140 | })($);
|
1130 | 1141 |
|
1131 |
| - that.renderLabelWithShape = function(data) { |
| 1142 | + that.renderLabelWithShape = function(data, customBtnProps) { |
1132 | 1143 | that.stepData = data;
|
| 1144 | + that.customBtnProps = customBtnProps; |
1133 | 1145 |
|
1134 | 1146 | function findParentDialog(element) {
|
1135 | 1147 | if (element.tagName === "MD-DIALOG") {
|
|
1425 | 1437 | else {
|
1426 | 1438 | distance = initial_distance;
|
1427 | 1439 | ver_button_position = initial_ver_position;
|
1428 |
| - that.$next_btn.html(that.stepData.nextBtnInitValue || 'Next'); |
1429 |
| - that.$prev_btn.html('Previous'); |
| 1440 | + that.$next_btn.html(customBtnProps.nextButton ? customBtnProps.nextButton.text : 'Next'); |
| 1441 | + that.$prev_btn.html(customBtnProps.prevButton ? customBtnProps.prevButton.text : 'Previous'); |
1430 | 1442 | }
|
1431 | 1443 |
|
1432 | 1444 | that.$prev_btn.css({
|
|
1574 | 1586 | return this;
|
1575 | 1587 | },
|
1576 | 1588 |
|
1577 |
| - render_label_with_shape: function(data, stopFunction) { |
| 1589 | + render_label_with_shape: function(data, stopFunction, customBtnProps) { |
1578 | 1590 | this.each(function() {
|
1579 | 1591 | that.stopFunction = stopFunction;
|
1580 |
| - this.enjoyhint_obj.renderLabelWithShape(data); |
| 1592 | + this.enjoyhint_obj.renderLabelWithShape(data, customBtnProps); |
1581 | 1593 | });
|
1582 | 1594 |
|
1583 | 1595 | return this;
|
|
0 commit comments