mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 07:01:12 +00:00
[header] removed 'search & avatar, account info' on the top right corner (#4596)
* cleaned up code & files
This commit is contained in:
@@ -1,57 +1,3 @@
|
||||
$(function() {
|
||||
$('.account-toggle').on('click', function() {
|
||||
var popup = $('#user-info-popup');
|
||||
popup.toggleClass('hide');
|
||||
if (!popup.hasClass('hide')) {
|
||||
var loading_tip = $('.loading-tip', popup),
|
||||
space_traffic = $('#space-traffic');
|
||||
loading_tip.show();
|
||||
space_traffic.addClass('hide');
|
||||
$('.error', popup).addClass('hide');
|
||||
$.ajax({
|
||||
url: space_traffic.data('url'),
|
||||
dataType: 'json',
|
||||
cache: false,
|
||||
success: function(data) {
|
||||
loading_tip.hide();
|
||||
space_traffic.html(data['html']).removeClass('hide');
|
||||
},
|
||||
error: function (xhr, textStatus, errorThrown) {
|
||||
if (xhr.responseText) {
|
||||
var error = JSON.parse(xhr.responseText).error;
|
||||
loading_tip.hide();
|
||||
if ($('.error', popup).length == 0) {
|
||||
loading_tip.after('<p class="error alc">' + error + '</p>');
|
||||
} else {
|
||||
$('.error', popup).removeClass('hide');
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
$(document).on('click', function(e) {
|
||||
var target = e.target || event.srcElement;
|
||||
var closePopup = function(popup, popup_switch) {
|
||||
if (!popup.hasClass('hide') && !popup.is(target) && !popup.find('*').is(target) && !popup_switch.is(target) && !popup_switch.find('*').is(target) ) {
|
||||
popup.addClass('hide');
|
||||
}
|
||||
};
|
||||
closePopup($('#user-info-popup'), $('.account-toggle'));
|
||||
});
|
||||
|
||||
// search: disable submit when input nothing
|
||||
$('.search-form').on('submit', function() {
|
||||
if (!$(this).find('.search-input').val().trim()) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('table').on('mouseenter', 'tr:gt(0)', function() {
|
||||
if (app.ui.currentDropDown || app.ui.freezeItemHightlight) {
|
||||
return;
|
||||
|
Reference in New Issue
Block a user