mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-25 06:33:48 +00:00
[dir view] rename: fix
This commit is contained in:
@@ -108,7 +108,7 @@ define([
|
|||||||
data: post_data,
|
data: post_data,
|
||||||
success: function(data) {
|
success: function(data) {
|
||||||
var renamed_dirent_data = {
|
var renamed_dirent_data = {
|
||||||
'obj_name': options.newname,
|
'obj_name': data.obj_name,
|
||||||
'last_modified': new Date().getTime()/1000,
|
'last_modified': new Date().getTime()/1000,
|
||||||
'last_update': gettext("Just now")
|
'last_update': gettext("Just now")
|
||||||
};
|
};
|
||||||
|
@@ -24,6 +24,7 @@ define([
|
|||||||
var $input = this.$('[name="newname"]');
|
var $input = this.$('[name="newname"]');
|
||||||
var dot_index = this.dirent.get('obj_name').lastIndexOf('.');
|
var dot_index = this.dirent.get('obj_name').lastIndexOf('.');
|
||||||
if (!this.dirent.get('is_dir') && dot_index != -1) {
|
if (!this.dirent.get('is_dir') && dot_index != -1) {
|
||||||
|
$input[0].focus();
|
||||||
$input[0].setSelectionRange(0, dot_index);
|
$input[0].setSelectionRange(0, dot_index);
|
||||||
} else {
|
} else {
|
||||||
$input.select();
|
$input.select();
|
||||||
|
@@ -371,6 +371,7 @@ define([
|
|||||||
var $input = $('[name="newname"]', form);
|
var $input = $('[name="newname"]', form);
|
||||||
var dot_index = dirent_name.lastIndexOf('.');
|
var dot_index = dirent_name.lastIndexOf('.');
|
||||||
if (!this.model.get('is_dir') && dot_index != -1) {
|
if (!this.model.get('is_dir') && dot_index != -1) {
|
||||||
|
$input[0].focus();
|
||||||
$input[0].setSelectionRange(0, dot_index);
|
$input[0].setSelectionRange(0, dot_index);
|
||||||
} else {
|
} else {
|
||||||
$input.select();
|
$input.select();
|
||||||
|
Reference in New Issue
Block a user