1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-08-31 22:54:11 +00:00

[lib/dirent] improved 'rename'

This commit is contained in:
llj
2016-08-12 19:10:49 +08:00
parent c4ffca620e
commit ab380bf361
3 changed files with 18 additions and 4 deletions

View File

@@ -15,9 +15,17 @@ define([
this.dir = options.dir;
this.render();
this.$el.modal({appendTo:'#main'});
this.$el.modal({appendTo:'#main', focus: false});
$('#simplemodal-container').css({'width':'auto', 'height':'auto'});
var $input = this.$('[name="newname"]');
var dot_index = this.dirent.get('obj_name').lastIndexOf('.');
if (!this.dirent.get('is_dir') && dot_index != -1) {
$input[0].setSelectionRange(0, dot_index);
} else {
$input.select();
}
this.$error = this.$('.error');
this.$form = this.$('form');
},