0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-14 05:52:52 +01:00
discourse-custom-wizard/assets/javascripts/discourse/initializers/custom-wizard-edits.js.es6

21 Zeilen
508 B
Text

import DiscourseURL from "discourse/lib/url";
2017-11-22 10:34:21 +01:00
export default {
name: "custom-wizard-edits",
initialize(container) {
const siteSettings = container.lookup("site-settings:main");
2021-04-12 08:12:20 +02:00
if (!siteSettings.custom_wizard_enabled) {
return;
}
const existing = DiscourseURL.routeTo;
DiscourseURL.routeTo = function (path, opts) {
if (path && path.indexOf("/w/") > -1) {
return (window.location = path);
}
return existing.apply(this, [path, opts]);
};
},
2017-11-22 10:34:21 +01:00
};