HDFS-15277. Parent directory in the explorer does not support all path formats. Contributed by Jianfei Jiang.
This commit is contained in:
parent
4d24d99e85
commit
cc5c1da7c1
@ -300,6 +300,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function browse_directory(dir) {
|
function browse_directory(dir) {
|
||||||
|
if (dir.match('^/+$')) {
|
||||||
|
$('#parentDir').prop('disabled', true);
|
||||||
|
} else {
|
||||||
|
$('#parentDir').prop('disabled', false);
|
||||||
|
}
|
||||||
var HELPERS = {
|
var HELPERS = {
|
||||||
'helper_date_tostring' : function (chunk, ctx, bodies, params) {
|
'helper_date_tostring' : function (chunk, ctx, bodies, params) {
|
||||||
var value = dust.helpers.tap(params.value, chunk, ctx);
|
var value = dust.helpers.tap(params.value, chunk, ctx);
|
||||||
@ -378,11 +383,10 @@
|
|||||||
|
|
||||||
|
|
||||||
$('#parentDir').click(function () {
|
$('#parentDir').click(function () {
|
||||||
var current = current_directory;
|
var current = current_directory;
|
||||||
var lastIndex = current.lastIndexOf('/');
|
var parent = current.replace(/\/+[^/]+\/*$/,"") || '/';
|
||||||
var parent = current.substr(0, lastIndex);
|
browse_directory(parent);
|
||||||
browse_directory(parent);
|
});
|
||||||
})
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer'));
|
dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer'));
|
||||||
|
@ -300,6 +300,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function browse_directory(dir) {
|
function browse_directory(dir) {
|
||||||
|
if (dir.match('^/+$')) {
|
||||||
|
$('#parentDir').prop('disabled', true);
|
||||||
|
} else {
|
||||||
|
$('#parentDir').prop('disabled', false);
|
||||||
|
}
|
||||||
var HELPERS = {
|
var HELPERS = {
|
||||||
'helper_date_tostring' : function (chunk, ctx, bodies, params) {
|
'helper_date_tostring' : function (chunk, ctx, bodies, params) {
|
||||||
var value = dust.helpers.tap(params.value, chunk, ctx);
|
var value = dust.helpers.tap(params.value, chunk, ctx);
|
||||||
@ -378,10 +383,9 @@
|
|||||||
|
|
||||||
$('#parentDir').click(function () {
|
$('#parentDir').click(function () {
|
||||||
var current = current_directory;
|
var current = current_directory;
|
||||||
var lastIndex = current.lastIndexOf('/');
|
var parent = current.replace(/\/+[^/]+\/*$/,"") || '/';
|
||||||
var parent = current.substr(0, lastIndex);
|
|
||||||
browse_directory(parent);
|
browse_directory(parent);
|
||||||
})
|
});
|
||||||
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user