From 17c31fc9d9280a60eda68a8e6ba5f9163c79d274 Mon Sep 17 00:00:00 2001 From: Lars Jung Date: Sun, 15 Jul 2012 18:58:10 +0200 Subject: [PATCH] Fixes issue 72: Duplicate tree entries and emtpy main view. --- src/_h5ai/js/inc/core/entry.js | 2 +- src/_h5ai/js/inc/model/entry.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/_h5ai/js/inc/core/entry.js b/src/_h5ai/js/inc/core/entry.js index 3e82d5fc..9764904b 100644 --- a/src/_h5ai/js/inc/core/entry.js +++ b/src/_h5ai/js/inc/core/entry.js @@ -1,7 +1,7 @@ modulejs.define('core/entry', ['$', 'core/parser', 'model/entry'], function ($, parser, Entry) { - var absHref = document.location.pathname.replace(/[^\/]*$/, ''); + var absHref = document.location.href.replace(/^.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, ''); parser.parse(absHref, $('body')); $('#data-apache-autoindex').remove(); diff --git a/src/_h5ai/js/inc/model/entry.js b/src/_h5ai/js/inc/model/entry.js index 85d080c8..dbbad6ac 100644 --- a/src/_h5ai/js/inc/model/entry.js +++ b/src/_h5ai/js/inc/model/entry.js @@ -2,7 +2,7 @@ modulejs.define('model/entry', ['_', 'core/types', 'core/ajax'], function (_, types, ajax) { var domain = document.domain, - location = document.location.pathname.replace(/[^\/]*$/, ''), + location = document.location.href.replace(/^.*:\/\/[^\/]*/, '').replace(/[^\/]*$/, ''), // utils