source: trunk/plugins/TakeATour/js/custom.patch @ 30941

Last change on this file since 30941 was 30941, checked in by plg, 9 years ago

bug 3198: upgrade Bootstrap tour to version 0.10.1 + change patch to replace toString.call by {}.toString.call (compatibility with IE)

File size: 1.9 KB
  • bootstrap-tour-standalone.js

    old new  
    870870                return step.path;
    871871            }
    872872          }).call(_this);
    873           current_path = [document.location.pathname, document.location.hash].join('');
     873          current_path = document.location.href;
    874874          if (_this._isRedirect(path, current_path)) {
     875            if ({}.toString.call(path) === "[object RegExp]") {
     876             _this._redirect(step, path);
     877          }
     878          else {
     879            path = document.location.protocol+'//'+path;
    875880            _this._redirect(step, path);
     881          }
    876882            return;
    877883          }
    878884          if (_this._isOrphan(step)) {
     
    887893            }
    888894            _this._debug("Show the orphan step " + (_this._current + 1) + ". Orphans option is true.");
    889895          }
     896        if (step.title  === "" & step.content  === "") {
     897            if (skipToPrevious) {
     898              _this._showPrevStep();
     899            } else {
     900              _this._showNextStep();
     901            }
     902            return;
     903        }
    890904          if (step.backdrop) {
    891905            _this._showBackdrop(!_this._isOrphan(step) ? step.element : void 0);
    892906          }
     
    10231037    };
    10241038
    10251039    Tour.prototype._isRedirect = function(path, currentPath) {
    1026       return (path != null) && path !== '' && (({}.toString.call(path) === '[object RegExp]' && !path.test(currentPath)) || ({}.toString.call(path) === '[object String]' && path.replace(/\?.*$/, '').replace(/\/?$/, '') !== currentPath.replace(/\/?$/, '')));
     1040      return (path != null) && path !== '' && (({}.toString.call(path) === '[object RegExp]' && !path.test(currentPath)) || ({}.toString.call(path) === '[object String]' && path !== currentPath.replace("http://", "").replace("https://", "")));
    10271041    };
    10281042
    10291043    Tour.prototype._redirect = function(step, path) {
Note: See TracBrowser for help on using the repository browser.