mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-28 08:06:56 +00:00
tmp mod
This commit is contained in:
@@ -2,8 +2,9 @@ define([
|
||||
'jquery',
|
||||
'underscore',
|
||||
'backbone',
|
||||
'common',
|
||||
'text!' + app.config._tmplRoot + 'group-repos.html'
|
||||
], function($, _, Backbone, reposTemplate) {
|
||||
], function($, _, Backbone, Common, reposTemplate) {
|
||||
'use strict';
|
||||
|
||||
var GroupRepoView = Backbone.View.extend({
|
||||
@@ -20,6 +21,8 @@ define([
|
||||
initialize: function() {
|
||||
console.log('init GroupRepoView');
|
||||
Backbone.View.prototype.initialize.apply(this, arguments);
|
||||
|
||||
this.listenTo(this.model, 'destroy', this.remove);
|
||||
},
|
||||
|
||||
render: function() {
|
||||
@@ -38,8 +41,29 @@ define([
|
||||
},
|
||||
|
||||
unshare: function() {
|
||||
this.model.destroy();
|
||||
}
|
||||
var that = this;
|
||||
var yesCallback = function() {
|
||||
Common.closeModal();
|
||||
Common.feedback(gettext('Loading...'), 'info', Common.INFO_TIMEOUT); // TODO: what if there is still response after 10 secs ?
|
||||
// send delete request and wait response
|
||||
that.model.destroy({
|
||||
wait: true,
|
||||
success: function(model, rep) {
|
||||
Common.feedback(gettext('Success'), 'success', Common.SUCCESS_TIMOUT);
|
||||
},
|
||||
error: function() {
|
||||
Common.feedback(gettext('Error'), 'error', Common.ERROR_TIMEOUT);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
Common.showConfirm(
|
||||
gettext('Unshare Library'),
|
||||
gettext('Are you sure you want to unshare {placeholder} ?')
|
||||
.replace(/\{placeholder\}/g, '<span class="op-target">' + this.model.get('name') + '</span>'),
|
||||
yesCallback
|
||||
);
|
||||
},
|
||||
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user