mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 15:09:14 +00:00
[system admin] libraries: added 'history setting'
This commit is contained in:
@@ -8,9 +8,12 @@ define([
|
||||
'select2',
|
||||
'jquery.ui.tabs',
|
||||
'sysadmin-app/views/share',
|
||||
'app/views/widgets/hl-item-view'
|
||||
'app/views/dialogs/repo-history-settings',
|
||||
'app/views/widgets/hl-item-view',
|
||||
'app/views/widgets/dropdown'
|
||||
], function($, _, Backbone, Common, Moment, Simplemodal,
|
||||
Select2, Tabs, ShareView, HLItemView) {
|
||||
Select2, Tabs, ShareView, HistorySettingsDialog,
|
||||
HLItemView, DropdownView) {
|
||||
|
||||
'use strict';
|
||||
|
||||
@@ -21,7 +24,8 @@ define([
|
||||
transferTemplate: _.template($('#library-transfer-form-tmpl').html()),
|
||||
|
||||
events: {
|
||||
'click .repo-share-btn': 'share',
|
||||
'click .js-repo-share': 'share',
|
||||
'click .js-popup-history-setting': 'popupHistorySetting',
|
||||
'click .repo-delete-btn': 'deleteLibrary',
|
||||
'click .repo-transfer-btn': 'transferLibrary'
|
||||
},
|
||||
@@ -32,9 +36,25 @@ define([
|
||||
'repo_name': this.model.get('name')
|
||||
};
|
||||
new ShareView(options);
|
||||
this.togglePopup(); // close the popup
|
||||
return false;
|
||||
},
|
||||
|
||||
popupHistorySetting: function() {
|
||||
var options = {
|
||||
'repo_name': this.model.get('name'),
|
||||
'repo_id': this.model.get('id'),
|
||||
'url_name': 'admin-library-history-limit'
|
||||
};
|
||||
this.togglePopup(); // close the popup
|
||||
new HistorySettingsDialog(options);
|
||||
return false;
|
||||
},
|
||||
|
||||
togglePopup: function() {
|
||||
this.dropdown.hide();
|
||||
},
|
||||
|
||||
initialize: function() {
|
||||
HLItemView.prototype.initialize.call(this);
|
||||
this.listenTo(this.model, "change", this.render);
|
||||
@@ -146,6 +166,11 @@ define([
|
||||
|
||||
this.$el.html(this.template(data));
|
||||
|
||||
this.dropdown = new DropdownView({
|
||||
el: this.$('.sf-dropdown'),
|
||||
right: 0
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user