Commit 22b8b24c by Jeffrey Phillips

Allow functions to be used for guided tour values

parent d5edcf0e
...@@ -1691,6 +1691,11 @@ angular.module('openshiftCommonUI').factory('GuidedTourService', function() { ...@@ -1691,6 +1691,11 @@ angular.module('openshiftCommonUI').factory('GuidedTourService', function() {
if (angular.isUndefined(step.yOffset) && (step.placement === 'right' || step.placement === 'left' )) { if (angular.isUndefined(step.yOffset) && (step.placement === 'right' || step.placement === 'left' )) {
step.yOffset = -45; step.yOffset = -45;
} }
step.title = _.isFunction(step.title) ? step.title() : step.title;
step.content = _.isFunction(step.content) ? step.content() : step.content;
step.target = _.isFunction(step.target) ? step.target() : step.target;
step.placement = _.isFunction(step.placement) ? step.placement() : step.placement;
}); });
} }
......
...@@ -4825,6 +4825,11 @@ angular.module('openshiftCommonUI').factory('GuidedTourService', function() { ...@@ -4825,6 +4825,11 @@ angular.module('openshiftCommonUI').factory('GuidedTourService', function() {
if (angular.isUndefined(step.yOffset) && (step.placement === 'right' || step.placement === 'left' )) { if (angular.isUndefined(step.yOffset) && (step.placement === 'right' || step.placement === 'left' )) {
step.yOffset = -45; step.yOffset = -45;
} }
step.title = _.isFunction(step.title) ? step.title() : step.title;
step.content = _.isFunction(step.content) ? step.content() : step.content;
step.target = _.isFunction(step.target) ? step.target() : step.target;
step.placement = _.isFunction(step.placement) ? step.placement() : step.placement;
}); });
} }
......
...@@ -2069,7 +2069,7 @@ $("#guided_tour_backdrop").remove(), angular.isFunction(hopscotchConfig.onTourEn ...@@ -2069,7 +2069,7 @@ $("#guided_tour_backdrop").remove(), angular.isFunction(hopscotchConfig.onTourEn
} }
function setupSteps() { function setupSteps() {
_.forEach(hopscotchConfig.steps, function(step) { _.forEach(hopscotchConfig.steps, function(step) {
step.onNextOrig = step.onNext, step.onPrevOrig = step.onPrev, step.onNext = onStepNext, step.onPrev = onStepPrev, step.fixedElement = !0, !angular.isUndefined(step.yOffset) || "right" !== step.placement && "left" !== step.placement || (step.yOffset = -45); step.onNextOrig = step.onNext, step.onPrevOrig = step.onPrev, step.onNext = onStepNext, step.onPrev = onStepPrev, step.fixedElement = !0, !angular.isUndefined(step.yOffset) || "right" !== step.placement && "left" !== step.placement || (step.yOffset = -45), step.title = _.isFunction(step.title) ? step.title() :step.title, step.content = _.isFunction(step.content) ? step.content() :step.content, step.target = _.isFunction(step.target) ? step.target() :step.target, step.placement = _.isFunction(step.placement) ? step.placement() :step.placement;
}); });
} }
function onStepNext() { function onStepNext() {
......
...@@ -57,6 +57,11 @@ angular.module('openshiftCommonUI').factory('GuidedTourService', function() { ...@@ -57,6 +57,11 @@ angular.module('openshiftCommonUI').factory('GuidedTourService', function() {
if (angular.isUndefined(step.yOffset) && (step.placement === 'right' || step.placement === 'left' )) { if (angular.isUndefined(step.yOffset) && (step.placement === 'right' || step.placement === 'left' )) {
step.yOffset = -45; step.yOffset = -45;
} }
step.title = _.isFunction(step.title) ? step.title() : step.title;
step.content = _.isFunction(step.content) ? step.content() : step.content;
step.target = _.isFunction(step.target) ? step.target() : step.target;
step.placement = _.isFunction(step.placement) ? step.placement() : step.placement;
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment