mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
33 lines
868 B
JavaScript
33 lines
868 B
JavaScript
"use strict";
|
|
/**
|
|
* @class elFinder ui
|
|
* Display current folder path in statusbar.
|
|
* Click on folder name in path - open folder
|
|
*
|
|
* @author Dmitry (dio) Levashov
|
|
**/
|
|
$.fn.elfinderpath = function(fm) {
|
|
return this.each(function() {
|
|
var path = $(this).addClass('elfinder-path').html(' ')
|
|
.delegate('a', 'click', function(e) {
|
|
var hash = $(this).attr('href').substr(1);
|
|
|
|
e.preventDefault();
|
|
hash != fm.cwd().hash && fm.exec('open', hash);
|
|
})
|
|
.prependTo(fm.getUI('statusbar').show())
|
|
|
|
fm.bind('open searchend', function() {
|
|
var dirs = [];
|
|
|
|
$.each(fm.parents(fm.cwd().hash), function(i, hash) {
|
|
dirs.push('<a href="#'+hash+'">'+fm.escape(fm.file(hash).name)+'</a>');
|
|
});
|
|
|
|
path.html(dirs.join(fm.option('separator')));
|
|
})
|
|
.bind('search', function() {
|
|
path.html(fm.i18n('searcresult'));
|
|
});
|
|
});
|
|
} |