HDFS-15239. Add button to go to the parent directory in the explorer. Contributed by hemanthboyina.
This commit is contained in:
parent
696a663cd0
commit
f7a94ec0a4
|
@ -172,7 +172,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-10 col-md-10">
|
<div class="col-xs-9 col-md-9">
|
||||||
<form onsubmit="return false;">
|
<form onsubmit="return false;">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" id="directory"/>
|
<input type="text" class="form-control" id="directory"/>
|
||||||
|
@ -182,7 +182,7 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-2 col-md-2">
|
<div class="col-xs-3 col-md-3">
|
||||||
<button type="button" class="btn btn-default" data-toggle="modal"
|
<button type="button" class="btn btn-default" data-toggle="modal"
|
||||||
aria-label="New Directory" data-target="#btn-create-directory"
|
aria-label="New Directory" data-target="#btn-create-directory"
|
||||||
title="Create Directory" id="btn-create-dir">
|
title="Create Directory" id="btn-create-dir">
|
||||||
|
@ -199,6 +199,10 @@
|
||||||
<li><a id="explorer-cut">Cut</a></li>
|
<li><a id="explorer-cut">Cut</a></li>
|
||||||
<li><a id="explorer-paste">Paste</a></li>
|
<li><a id="explorer-paste">Paste</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<button type="button" class="btn btn-default" data-toggle="modal"
|
||||||
|
aria-label="Parent Directory" title="Parent Directory" id="parentDir">
|
||||||
|
<span class="glyphicon glyphicon-level-up"></span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -377,6 +377,13 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$('#parentDir').click(function () {
|
||||||
|
var current = current_directory;
|
||||||
|
var lastIndex = current.lastIndexOf('/');
|
||||||
|
var parent = current.substr(0, lastIndex);
|
||||||
|
browse_directory(parent);
|
||||||
|
})
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer'));
|
dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer'));
|
||||||
dust.loadSource(dust.compile($('#tmpl-block-info').html(), 'block-info'));
|
dust.loadSource(dust.compile($('#tmpl-block-info').html(), 'block-info'));
|
||||||
|
|
|
@ -172,7 +172,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-10 col-md-10">
|
<div class="col-xs-9 col-md-9">
|
||||||
<form onsubmit="return false;">
|
<form onsubmit="return false;">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<input type="text" class="form-control" id="directory"/>
|
<input type="text" class="form-control" id="directory"/>
|
||||||
|
@ -182,7 +182,7 @@
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-2 col-md-2">
|
<div class="col-xs-3 col-md-3">
|
||||||
<button type="button" class="btn btn-default" data-toggle="modal"
|
<button type="button" class="btn btn-default" data-toggle="modal"
|
||||||
aria-label="New Directory" data-target="#btn-create-directory"
|
aria-label="New Directory" data-target="#btn-create-directory"
|
||||||
title="Create Directory" id="btn-create-dir">
|
title="Create Directory" id="btn-create-dir">
|
||||||
|
@ -199,6 +199,10 @@
|
||||||
<li><a id="explorer-cut">Cut</a></li>
|
<li><a id="explorer-cut">Cut</a></li>
|
||||||
<li><a id="explorer-paste">Paste</a></li>
|
<li><a id="explorer-paste">Paste</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
<button type="button" class="btn btn-default" data-toggle="modal"
|
||||||
|
aria-label="Parent Directory" title="Parent Directory" id="parentDir">
|
||||||
|
<span class="glyphicon glyphicon-level-up"></span>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -376,6 +376,13 @@
|
||||||
}).fail(network_error_handler(url));
|
}).fail(network_error_handler(url));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$('#parentDir').click(function () {
|
||||||
|
var current = current_directory;
|
||||||
|
var lastIndex = current.lastIndexOf('/');
|
||||||
|
var parent = current.substr(0, lastIndex);
|
||||||
|
browse_directory(parent);
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer'));
|
dust.loadSource(dust.compile($('#tmpl-explorer').html(), 'explorer'));
|
||||||
|
|
Loading…
Reference in New Issue