1
0
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:
llj
2017-08-11 17:51:11 +08:00
parent 466ef48116
commit c6e8b64492
9 changed files with 82 additions and 44 deletions

View File

@@ -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;
}