Handle wizard routes in DiscourseURL.routeTo
Dieser Commit ist enthalten in:
Ursprung
c3f7257a2b
Commit
5d6506355e
1 geänderte Dateien mit 9 neuen und 0 gelöschten Zeilen
|
@ -1,4 +1,5 @@
|
||||||
import { withPluginApi } from 'discourse/lib/plugin-api';
|
import { withPluginApi } from 'discourse/lib/plugin-api';
|
||||||
|
import DiscourseURL from 'discourse/lib/url';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'custom-wizard-edits',
|
name: 'custom-wizard-edits',
|
||||||
|
@ -21,5 +22,13 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const existing = DiscourseURL.routeTo;
|
||||||
|
DiscourseURL.routeTo = function(path, opts) {
|
||||||
|
if (path.indexOf('/w/') > -1) {
|
||||||
|
return window.location = path;
|
||||||
|
}
|
||||||
|
return existing.apply(this, [path, opts]);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Laden …
In neuem Issue referenzieren