Skip to content

Commit c0bd556

Browse files
authored
Merge pull request #1066 from Patternslib/fix-navigation
fix incorrect navigation state after injection happens
2 parents a13313c + a02488d commit c0bd556

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/pat/inject/inject.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,8 +456,14 @@ const inject = {
456456
const $injected = cfg.$injected || $src;
457457
// Now the injection actually happens.
458458
if (this._inject(trigger, $src, $(target), cfg)) {
459+
// Update history
460+
this._update_history(cfg, trigger, title);
461+
// Post-injection
459462
this._afterInjection($el, $injected, cfg);
460463
}
464+
},
465+
466+
_update_history(cfg, trigger, title) {
461467
// History support. if subform is submitted, append form params
462468
const glue = cfg.url.indexOf("?") > -1 ? "&" : "?";
463469
if (cfg.history === "record" && "pushState" in history) {

src/pat/navigation/navigation.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export default Base.extend({
7070
* Initial run to mark the current item and its parents.
7171
*/
7272
init_markings() {
73-
if (this.el.querySelector(this.options.currentClass)) {
73+
if (this.el.querySelector(`.${this.options.currentClass}`)) {
7474
log.debug("Mark navigation items based on existing current class");
7575
this.mark_current();
7676
} else {

0 commit comments

Comments
 (0)