Use `N.wire.once('navigate.done', ...` instead of `$(function () { ... })`