Commit b2a844f6 authored by Tomas Pettersson's avatar Tomas Pettersson 🏸

guide fixes

parent e44d079c
......@@ -157,7 +157,8 @@ app.get('/demo/guide/os',
exitOnOverlayClick: false,
disableInteraction: false,
showBullets: false,
scrollToElement: false
scrollToElement: false,
skipLabel: "Cancel"
}
);
});
......
......@@ -1242,6 +1242,13 @@ var L;
}
return false;
};
OilSpill.prototype.deleteParam = function (name, params) {
for (var i = 0; i < params.length; i++) {
if (params[i][0] == name)
params.splice(i, 1);
;
}
};
OilSpill.prototype.replaceParam = function (name, newid, params) {
for (var i = 0; i < params.length; i++) {
if (params[i][0] == name)
......@@ -1293,6 +1300,16 @@ var L;
var intro = introJs();
intro.setOptions(guide);
var prevElement = null;
function finish() {
var param = self.getURLParams();
if (self.hasParam('guide', 'os', param))
self.deleteParam('guide', param);
var search = self.getSearchUrl(param);
if (history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + search;
window.history.pushState({ path: newurl }, '', newurl);
}
}
intro.onbeforechange(function (targetElement) {
(prevElement && prevElement.guideFn && prevElement.guideFn());
prevElement = targetElement;
......@@ -1300,6 +1317,9 @@ var L;
intro.oncomplete(function () {
self.startButton.click();
});
intro.onexit(function () {
finish();
});
intro.start();
}
});
......
......@@ -334,6 +334,13 @@ var L;
}
return false;
};
OilSpill.prototype.deleteParam = function (name, params) {
for (var i = 0; i < params.length; i++) {
if (params[i][0] == name)
params.splice(i, 1);
;
}
};
OilSpill.prototype.replaceParam = function (name, newid, params) {
for (var i = 0; i < params.length; i++) {
if (params[i][0] == name)
......@@ -385,6 +392,16 @@ var L;
var intro = introJs();
intro.setOptions(guide);
var prevElement = null;
function finish() {
var param = self.getURLParams();
if (self.hasParam('guide', 'os', param))
self.deleteParam('guide', param);
var search = self.getSearchUrl(param);
if (history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + search;
window.history.pushState({ path: newurl }, '', newurl);
}
}
intro.onbeforechange(function (targetElement) {
(prevElement && prevElement.guideFn && prevElement.guideFn());
prevElement = targetElement;
......@@ -392,6 +409,9 @@ var L;
intro.oncomplete(function () {
self.startButton.click();
});
intro.onexit(function () {
finish();
});
intro.start();
}
});
......
This diff is collapsed.
......@@ -345,6 +345,12 @@ module L.Control {
return false;
}
private deleteParam(name, params) {
for (var i = 0; i < params.length; i++) {
if (params[i][0] == name) params.splice(i, 1);;
}
}
private replaceParam(name, newid, params) {
for (var i = 0; i < params.length; i++) {
if (params[i][0] == name) params[i][1] = newid;
......@@ -400,13 +406,25 @@ module L.Control {
var intro = introJs();
intro.setOptions(guide);
var prevElement = null;
function finish() {
var param = self.getURLParams();
if (self.hasParam('guide', 'os', param)) self.deleteParam('guide', param);
var search = self.getSearchUrl(param);
if (history.pushState) {
var newurl = window.location.protocol + "//" + window.location.host + window.location.pathname + search;
window.history.pushState({ path: newurl }, '', newurl);
}
}
intro.onbeforechange(function (targetElement) {
(prevElement && prevElement.guideFn && prevElement.guideFn())
prevElement = targetElement;
});
intro.oncomplete(function() {
self.startButton.click();
});
});
intro.onexit(function () {
finish();
});
intro.start();
}
});
......
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