Skip to content

Commit

Permalink
[cwd] correction for touch devices ( fix Studio-42#266 )
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Sep 1, 2013
1 parent 3867757 commit c843ffc
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion js/ui/cwd.js
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ $.fn.elfindercwd = function(fm, options) {
var parent = $.extend(true, {}, fm.file(phash), {name : '..', mime : 'directory'});
parent = $(itemhtml(parent))
.addClass('elfinder-cwd-parent')
.bind('mousedown click mouseup dblclick mouseenter', function(e) {
.bind('mousedown click mouseup touchstart touchmove touchend dblclick mouseenter', function(e) {
e.preventDefault();
e.stopPropagation();
})
Expand Down Expand Up @@ -709,6 +709,20 @@ $.fn.elfindercwd = function(fm, options) {
.delegate(fileSelector, 'dblclick.'+fm.namespace, function(e) {
fm.dblclick({file : this.id});
})
// call fm.open() for touch device
.delegate(fileSelector, 'touchend.'+fm.namespace, function(e) {
var p = this.id ? $(this) : $(this).parents('[id]:first');
if (p.is('.'+clSelected)) {
fm.dblclick({file : this.id});
}
})
// unselect on scrolling for touch device
.delegate(fileSelector, 'touchmove.'+fm.namespace, function(e) {
var p = this.id ? $(this) : $(this).parents('[id]:first');
if (p.is('.'+clSelected)) {
p.trigger(evtUnselect);
}
})
// attach draggable
.delegate(fileSelector, 'mouseenter.'+fm.namespace, function(e) {
var $this = $(this),
Expand Down

0 comments on commit c843ffc

Please sign in to comment.