remove textbox after pressing "enter" even if the name is the same
This commit is contained in:
parent
39735721ec
commit
92b37119e3
|
@ -157,22 +157,21 @@ var FileList={
|
|||
});
|
||||
|
||||
}
|
||||
|
||||
tr.attr('data-file', newname);
|
||||
var path = td.children('a.name').attr('href');
|
||||
td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname)));
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
var basename=newname.substr(0,newname.lastIndexOf('.'));
|
||||
} else {
|
||||
var basename=newname;
|
||||
}
|
||||
td.children('a.name').empty();
|
||||
var span=$('<span class="nametext"></span>');
|
||||
span.text(basename);
|
||||
td.children('a.name').append(span);
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
||||
}
|
||||
}
|
||||
tr.attr('data-file', newname);
|
||||
var path = td.children('a.name').attr('href');
|
||||
td.children('a.name').attr('href', path.replace(encodeURIComponent(name), encodeURIComponent(newname)));
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
var basename=newname.substr(0,newname.lastIndexOf('.'));
|
||||
} else {
|
||||
var basename=newname;
|
||||
}
|
||||
td.children('a.name').empty();
|
||||
var span=$('<span class="nametext"></span>');
|
||||
span.text(basename);
|
||||
td.children('a.name').append(span);
|
||||
if (newname.indexOf('.') > 0 && tr.data('type') != 'dir') {
|
||||
span.append($('<span class="extension">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
|
||||
}
|
||||
return false;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue