mirror of
https://github.com/haiwen/seahub.git
synced 2025-09-01 23:20:51 +00:00
new design
This commit is contained in:
@@ -11,12 +11,12 @@ define([
|
||||
var View = Backbone.View.extend({
|
||||
|
||||
id: 'file-comments',
|
||||
className: 'right-side-panel',
|
||||
className: 'comments-panel',
|
||||
|
||||
template: _.template($('#file-comment-panel-tmpl').html()),
|
||||
|
||||
initialize: function() {
|
||||
$("#main").append(this.$el);
|
||||
initialize: function(options) {
|
||||
this.dirView = options.dirView;
|
||||
|
||||
this.collection = new Collection();
|
||||
this.listenTo(this.collection, 'add', this.addOne);
|
||||
@@ -29,9 +29,6 @@ define([
|
||||
_this.hide();
|
||||
}
|
||||
});
|
||||
$(window).resize(function() {
|
||||
_this.setConHeight();
|
||||
});
|
||||
},
|
||||
|
||||
events: {
|
||||
@@ -65,14 +62,21 @@ define([
|
||||
'icon_url': options.icon_url,
|
||||
'file_name': options.file_name
|
||||
});
|
||||
this.$el.css({'right': 0});
|
||||
this.setConHeight();
|
||||
|
||||
if ($('#' + this.id).length == 0) {
|
||||
this.dirView.$mainCon.append(this.$el);
|
||||
if (!this.$el.is(':visible')) {
|
||||
this.$el.show();
|
||||
}
|
||||
} else {
|
||||
this.$el.show();
|
||||
}
|
||||
|
||||
this.getContent();
|
||||
},
|
||||
|
||||
hide: function() {
|
||||
this.$el.css({'right': '-400px'});
|
||||
this.$el.empty();
|
||||
this.$el.hide();
|
||||
},
|
||||
|
||||
reset: function() {
|
||||
@@ -178,15 +182,6 @@ define([
|
||||
this.$listContainer.append(view.render().el);
|
||||
},
|
||||
|
||||
setConHeight: function() {
|
||||
$('.file-discussions-con', this.$el).css({
|
||||
'max-height': $(window).height()
|
||||
- this.$el.offset().top
|
||||
- $('.file-discussions-hd', this.$el).outerHeight(true)
|
||||
- $('.file-discussions-footer', this.$el).outerHeight(true)
|
||||
});
|
||||
},
|
||||
|
||||
scrollConToBottom: function() {
|
||||
var $el = this.$('.file-discussions-con');
|
||||
$el.scrollTop($el[0].scrollHeight - $el[0].clientHeight);
|
||||
|
Reference in New Issue
Block a user