if (members) {\r
$('#memberlists').show();\r
members.view.show();\r
- this.$container.parent().css('right', '200px');\r
} else {\r
// Memberlist not found for this panel, hide any active ones\r
$('#memberlists').hide().children().removeClass('active');\r
- this.$container.parent().css('right', '0');\r
}\r
\r
+ kiwi.app.view.doLayout();\r
+\r
this.scrollToBottom();\r
this.alert('none');\r
\r
\r
\r
\r
+kiwi.view.ResizeHandler = Backbone.View.extend({\r
+ events: {\r
+ 'mousedown': 'startDrag',\r
+ 'mouseup': 'stopDrag'\r
+ },\r
+\r
+ dragging: false,\r
+ starting_width: {},\r
+\r
+ initialize: function () {\r
+ $(window).on('mousemove', $.proxy(this.onDrag, this));\r
+ },\r
+\r
+ startDrag: function (event) {\r
+ this.dragging = true;\r
+ },\r
+\r
+ stopDrag: function (event) {\r
+ this.dragging = false;\r
+ },\r
+\r
+ onDrag: function (event) {\r
+ if (!this.dragging) return;\r
+\r
+ this.$el.css('left', event.clientX - (this.$el.outerWidth(true) / 2));\r
+ $('#memberlists').css('width', this.$el.parent().width() - (this.$el.position().left + this.$el.outerWidth()));\r
+ kiwi.app.view.doLayout();\r
+ }\r
+});\r
+\r
+\r
+\r
kiwi.view.Application = Backbone.View.extend({\r
initialize: function () {\r
$(window).resize(this.doLayout);\r
var el_memberlists = $('#memberlists');\r
var el_toolbar = $('#toolbar');\r
var el_controlbox = $('#controlbox');\r
+ var el_resize_handle = $('#memberlists_resize_handle');\r
\r
var css_heights = {\r
top: el_toolbar.outerHeight(true),\r
\r
el_panels.css(css_heights);\r
el_memberlists.css(css_heights);\r
+ el_resize_handle.css(css_heights);\r
+\r
+ if (el_memberlists.css('display') != 'none') {\r
+ // Handle + panels to the side of the memberlist\r
+ el_panels.css('right', el_memberlists.outerWidth(true) + el_resize_handle.outerWidth(true));\r
+ el_resize_handle.css('left', el_memberlists.position().left - el_resize_handle.outerWidth(true));\r
+ } else {\r
+ // Memberlist is hidden so handle + panels to the right edge\r
+ el_panels.css('right', el_resize_handle.outerWidth(true));\r
+ el_resize_handle.css('left', el_panels.outerWidth(true));\r
+ }\r
},\r
\r
\r