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

Clean code and fix bugs

This commit is contained in:
Daniel Pan
2016-03-22 16:09:40 +08:00
parent 2e5ced905f
commit cb02bca661
3 changed files with 20 additions and 55 deletions

View File

@@ -55,34 +55,6 @@ define([
return this;
},
_hidePopover: function(e) {
var view = e.data.view;
var target = e.target || event.srcElement;
if (!$('.js-toggle-repos, .device-libs-popover').is(target)) {
$('.device-libs-popover').addClass('hide');
$('.dir-icon').removeClass('icon-caret-up').addClass('icon-caret-down');
view.rmHighlight();
$(document).off('click', view._hidePopover);
}
},
toggleSyncedRepos: function(e) {
var $icon= this.$('.dir-icon'),
$popover = this.$('.device-libs-popover');
if ($popover.is(':hidden')) {
$icon.removeClass('icon-caret-down').addClass('icon-caret-up');
$popover.removeClass('hide');
$(document).on('click', { view: this }, this._hidePopover);
} else {
$icon.removeClass('icon-caret-up').addClass('icon-caret-down');
$popover.addClass('hide');
$(document).off('click', this._hidePopover);
}
return false;
},
unlinkDevice: function() {
var _this = this,
device_name = this.model.get('device_name');