Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Simo:
- // Easiest way to do it is to store a reference to the original task in the same place where you null it. So the customTask becomes:
- function() {
- var cookieConsent = {{cookieConsent}};
- return function(model) {
- if (cookieConsent === 'opt-out') {
- window._originalDisplayFeaturesTask = model.get('displayFeaturesTask');
- model.set('displayFeaturesTask', null);
- }
- };
- }
- // and then if you want to "reset" the task, you can set
- model.set('displayFeaturesTask', window._originalDisplayFeaturesTask)
- // in customTask.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement