I have created a Django application django-joyride on top of this library where joyrides are configurable through admin panel. As now all the configuration is managed through admin, It is necessary that postExposeCallback etc callbacks should accept function name as string:
postExposeCallback: "my_callback_name"
You just need to add below lines in non configurable settings in order to achieve that:
// check if callbacks are passed as string
if (typeof settings.postExposeCallback !== "function"){
settings.postExposeCallback = window[settings.postExposeCallback];
}
if (typeof settings.preRideCallback !== "function"){
settings.preRideCallback = window[settings.preRideCallback];
}
if (typeof settings.postRideCallback !== "function"){
settings.postRideCallback = window[settings.postRideCallback];
}
if (typeof settings.preStepCallback !== "function"){
settings.preStepCallback = window[settings.preStepCallback];
}
if (typeof settings.postStepCallback !== "function"){
settings.postStepCallback = window[settings.postStepCallback];
}
I have created a Django application django-joyride on top of this library where joyrides are configurable through admin panel. As now all the configuration is managed through admin, It is necessary that
postExposeCallback
etc callbacks should accept function name as string:You just need to add below lines in non configurable settings in order to achieve that: