mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-17 15:53:28 +00:00
[rename] click outside the form to hide the form
This commit is contained in:
@@ -89,6 +89,16 @@ define([
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// hide 'rename form'
|
||||||
|
$(document).click(function(e) {
|
||||||
|
var target = e.target || event.srcElement;
|
||||||
|
var $form = $('#rename-form');
|
||||||
|
if ($form.length && !$form.find('*').is(target)) {
|
||||||
|
$('.cancel', $form).click();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
showDir: function(category, repo_id, path) {
|
showDir: function(category, repo_id, path) {
|
||||||
|
@@ -67,13 +67,13 @@ define([
|
|||||||
},
|
},
|
||||||
|
|
||||||
highlight: function() {
|
highlight: function() {
|
||||||
if (app.globalState.noFileOpPopup) {
|
if (app.globalState.noFileOpPopup && !$('#rename-form').length) {
|
||||||
this.$el.addClass('hl').find('.repo-file-op').removeClass('vh');
|
this.$el.addClass('hl').find('.repo-file-op').removeClass('vh');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
rmHighlight: function() {
|
rmHighlight: function() {
|
||||||
if (app.globalState.noFileOpPopup) {
|
if (app.globalState.noFileOpPopup && !$('#rename-form').length) {
|
||||||
this.$el.removeClass('hl').find('.repo-file-op').addClass('vh');
|
this.$el.removeClass('hl').find('.repo-file-op').addClass('vh');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -236,6 +236,8 @@ define([
|
|||||||
$td.attr('colspan', 1).css({
|
$td.attr('colspan', 1).css({
|
||||||
'width': $name.width()
|
'width': $name.width()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
_this.$el.removeClass('hl').find('.repo-file-op').addClass('vh');
|
||||||
};
|
};
|
||||||
$('.cancel', form).click(cancelRename);
|
$('.cancel', form).click(cancelRename);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user