Skip to content

Commit

Permalink
fix navigation path
Browse files Browse the repository at this point in the history
  • Loading branch information
wellingguzman committed Oct 27, 2016
1 parent 5f7d7e4 commit 01397b5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ require(["config", 'polyfills'], function() {
'core/ListViewManager',
'core/idle',
'tool-tips',
'utils',
'contextual-date',
'core/notification'
],

function(app, UIManager, Router, Backbone, alerts, __t, Tabs, Bookmarks, Messages, SchemaManager, SettingsCollection, ExtensionManager, EntriesManager, ListViewManager, Idle, ToolTip, ContextualDate, Notification) {
function(app, UIManager, Router, Backbone, alerts, __t, Tabs, Bookmarks, Messages, SchemaManager, SettingsCollection, ExtensionManager, EntriesManager, ListViewManager, Idle, ToolTip, Utils, ContextualDate, Notification) {

"use strict";

Expand Down Expand Up @@ -565,7 +566,10 @@ require(["config", 'polyfills'], function() {

// Remove the directus sub-path from the anchor href
// Backbone.history already have app.root as root.
var path = (href.attr || '').slice(app.root.length);
var path = (href.attr || '/');
if (Utils.stringStartsWith(path, app.root)) {
path = path.slice(app.root.length);
}

// `Backbone.history.navigate` is sufficient for all Routers and will
// trigger the correct events. The Router's internal `navigate` method
Expand Down

0 comments on commit 01397b5

Please sign in to comment.