moksha/public/javascript/ui/moksha.ui.tabs.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
New commits: commit bad18a7b73c7df3175670944c0ebf77656c6e85a Author: John (J5) Palmieri johnp@redhat.com Date: Mon May 18 17:08:41 2009 -0400
fail whale redirect
* redirect to a failure page when a hash requested tab can not be found * fix hashToIndex to return the first tab if the hash path elements are less than the number of nested nav elements (e.g. you can specify the full path of /package_maintanance/all_packages or simply /package_maintanance. Both are valid paths.)
diff --git a/moksha/public/javascript/ui/moksha.ui.tabs.js b/moksha/public/javascript/ui/moksha.ui.tabs.js index bc3575c..10ad65a 100644 --- a/moksha/public/javascript/ui/moksha.ui.tabs.js +++ b/moksha/public/javascript/ui/moksha.ui.tabs.js @@ -1,16 +1,16 @@ // This file is part of Moksha. // Copyright (C) 2008-2009 Red Hat, Inc. -// +// // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU Affero General Public License as // published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. -// +// // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Affero General Public License for more details. -// +// // You should have received a copy of the GNU Affero General Public License // along with this program. If not, see http://www.gnu.org/licenses/.
@@ -217,6 +217,10 @@ $.widget("ui.mokshatabs", { }, 500); } scrollTo(0, 0); + } else { + // invalid path, redirect to /invalid_path + path = location.hash.substring(1); + location.href=moksha.url('/invalid_path', {invalid_path: path}); }
} @@ -579,7 +583,7 @@ $.widget("ui.mokshatabs", {
var id_index = level + offset; if (id_index >= hash.length) - return -1; + return 0;
var id = "#" + hash[level + offset];
moksha-commits@lists.fedorahosted.org