mirror of
https://github.com/Studio-42/elFinder
synced 2026-06-08 12:37:09 +00:00
fixes #319. this is not brilliant solution but one I found
This commit is contained in:
@@ -144,6 +144,7 @@
|
||||
border:1px solid #8cafed;
|
||||
}
|
||||
|
||||
|
||||
.elfinder-place-drag .elfinder-navbar-dir { font-size:.9em;}
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
.elfinder .elfinder-navbar { background:#dde4eb; }
|
||||
.elfinder-navbar .ui-state-hover { background:transparent; border-color:transparent; }
|
||||
.elfinder-navbar .ui-state-active { background: #3875d7; border-color:#3875d7; color:#fff; }
|
||||
.elfinder-navbar .elfinder-droppable-active {background:#A7C6E5 !important;}
|
||||
/* disabled elfinder */
|
||||
.elfinder-disabled .elfinder-navbar .ui-state-active { background: #dadada; border-color:#aaa; color:#fff; }
|
||||
|
||||
|
||||
+4
-4
@@ -147,15 +147,15 @@
|
||||
// url : 'php/connector.php',
|
||||
url : 'php/connector.php',
|
||||
// transport : new elFinderSupportVer1(),
|
||||
getFileCallback : function(files, fm) {
|
||||
console.log(files);
|
||||
},
|
||||
// getFileCallback : function(files, fm) {
|
||||
// console.log(files);
|
||||
// },
|
||||
handlers : {
|
||||
select : function(event, elfinderInstance) {
|
||||
var selected = event.data.selected;
|
||||
|
||||
if (selected.length) {
|
||||
console.log(elfinderInstance.file(selected[0]))
|
||||
// console.log(elfinderInstance.file(selected[0]))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -541,7 +541,7 @@ window.elFinder = function(node, opts) {
|
||||
* @type Object
|
||||
**/
|
||||
this.droppable = {
|
||||
greedy : true,
|
||||
// greedy : true,
|
||||
tolerance : 'pointer',
|
||||
accept : '.elfinder-cwd-file-wrapper,.elfinder-navbar-dir,.elfinder-cwd-file',
|
||||
hoverClass : this.res('class', 'adroppable'),
|
||||
|
||||
+1
-2
@@ -417,7 +417,6 @@ $.fn.elfindercwd = function(fm) {
|
||||
droppable = $.extend({}, fm.droppable, {
|
||||
over : function(e, ui) {
|
||||
var hash = fm.cwd().hash;
|
||||
|
||||
$.each(ui.helper.data('files'), function(i, h) {
|
||||
if (fm.file(h).phash == hash) {
|
||||
cwd.removeClass(clDropActive);
|
||||
@@ -614,7 +613,7 @@ $.fn.elfindercwd = function(fm) {
|
||||
// console.log(files)
|
||||
try {
|
||||
// to avoid problem with draggable
|
||||
cwd.children('table,'+fileSelector).remove().end();
|
||||
cwd.children('table,'+fileSelector).remove();
|
||||
} catch (e) {
|
||||
cwd.html('');
|
||||
}
|
||||
|
||||
+27
-9
@@ -109,23 +109,39 @@ $.fn.elfindertree = function(fm, opts) {
|
||||
*/
|
||||
droppable = fm.res(c, 'droppable'),
|
||||
|
||||
insideNavbar = function(x) {
|
||||
var left = navbar.offset().left;
|
||||
|
||||
return left <= x && x <= left + navbar.width();
|
||||
},
|
||||
|
||||
drop = fm.droppable.drop,
|
||||
|
||||
/**
|
||||
* Droppable options
|
||||
*
|
||||
* @type Object
|
||||
*/
|
||||
droppableopts = $.extend({}, fm.droppable, {
|
||||
hoverClass : hover+' '+dropover,
|
||||
droppableopts = $.extend(true, {}, fm.droppable, {
|
||||
// show subfolders on dropover
|
||||
over : function() {
|
||||
var link = $(this);
|
||||
over : function(e) {
|
||||
var link = $(this),
|
||||
cl = hover+' '+dropover;
|
||||
|
||||
if (insideNavbar(e.clientX)) {
|
||||
link.addClass(cl)
|
||||
if (link.is('.'+collapsed+':not(.'+expanded+')')) {
|
||||
setTimeout(function() {
|
||||
link.is('.'+dropover) && link.children('.'+arrow).click();
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
link.removeClass(cl);
|
||||
}
|
||||
}),
|
||||
},
|
||||
out : function() { $(this).removeClass(hover+' '+dropover); },
|
||||
drop : function(e, ui) { insideNavbar(e.clientX) && drop.call(this, e, ui); }
|
||||
}),
|
||||
|
||||
spinner = $(fm.res('tpl', 'navspinner')),
|
||||
|
||||
@@ -333,6 +349,8 @@ $.fn.elfindertree = function(fm, opts) {
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Navigation tree
|
||||
*
|
||||
@@ -407,11 +425,11 @@ $.fn.elfindertree = function(fm, opts) {
|
||||
'x' : e.clientX,
|
||||
'y' : e.clientY
|
||||
});
|
||||
})
|
||||
}),
|
||||
// move tree into navbar
|
||||
navbar = fm.getUI('navbar').append(tree).show()
|
||||
|
||||
;
|
||||
// move tree into navbar
|
||||
tree.parent().find('.elfinder-navbar').append(tree).show();
|
||||
|
||||
fm.open(function(e) {
|
||||
var data = e.data,
|
||||
|
||||
Reference in New Issue
Block a user