1
0
mirror of https://github.com/haiwen/seahub.git synced 2025-09-16 15:19:06 +00:00

[rename] bugfix for 'cancelRename', improved 'click doc to hide form'

This commit is contained in:
llj
2015-09-15 15:17:06 +08:00
parent 3ba435b1d6
commit 805b73ea3b
2 changed files with 12 additions and 3 deletions

View File

@@ -95,10 +95,18 @@ define([
var target = e.target || event.srcElement;
var $form = $('#rename-form');
if ($form.length && !$form.find('*').is(target)) {
var $tr = $form.closest('tr'); // get $tr before $form removed in `.cancel click()`
$('.cancel', $form).click();
if (!$tr.find('*').is(target)) {
$tr.removeClass('hl').find('.repo-file-op').addClass('vh');
$('.repo-file-list tr:gt(0)').each(function() {
if ($(this).find('*').is(target)) {
$(this).addClass('hl').find('.repo-file-op').removeClass('vh');
}
});
}
}
});
},
showDir: function(category, repo_id, path) {

View File

@@ -222,6 +222,8 @@ define([
$op.hide();
$name.hide();
this.$('.hidden-op').addClass('hide');
var cancelRename = function() {
form.remove();
$op.show();
@@ -229,8 +231,7 @@ define([
$td.attr('colspan', 1).css({
'width': $name.width()
});
_this.$el.removeClass('hl').find('.repo-file-op').addClass('vh');
return false; // stop bubbling (to 'doc click to hide .hidden-op')
};
$('.cancel', form).click(cancelRename);