1 _kiwi
.view
.ResizeHandler
= Backbone
.View
.extend({
3 'mousedown': 'startDrag',
7 initialize: function () {
9 this.starting_width
= {};
11 $(window
).on('mousemove', $.proxy(this.onDrag
, this));
14 startDrag: function (event
) {
18 stopDrag: function (event
) {
19 this.dragging
= false;
22 onDrag: function (event
) {
23 if (!this.dragging
) return;
25 var offset
= $('#kiwi').offset().left
;
27 this.$el
.css('left', event
.clientX
- (this.$el
.outerWidth(true) / 2) - offset
);
28 $('#kiwi .right_bar').css('width', this.$el
.parent().width() - (this.$el
.position().left
+ this.$el
.outerWidth()));
29 _kiwi
.app
.view
.doLayout();