Permalink
Browse files

Fixes issue with control pane falling off the screen.

  • Loading branch information...
1 parent 32cc8fc commit e43f1f2ab3d03c8a6f16f5e7a19f0ebca52d147d @jeremyckahn committed Jun 24, 2012
Showing with 7 additions and 9 deletions.
  1. +1 −1 bin/app.js
  2. +6 −8 src/ui/pane.js
View
View
@@ -32,19 +32,17 @@ define(['exports'], function (pane) {
.dragon({
'within': this.$el.parent()
,'handle': '.pane-handle'
- ,'onDragEnd': _.bind(this.onDragStop, this)
})
this.oldSize = this.getSize();
+ $win.on('resize', _.bind(this.onResize, this));
}
- // This may be unnecessary...
- ,'onResize': function () {
- this.oldSize = this.getSize();
- }
+ ,'onResize': function (evt) {
+ var width = this.$el.outerWidth(true);
+ var winWidth = $win.width();
- ,'onDragStop': function (evt, ui) {
- if (this.$el.position().top < 0) {
- this.$el.css('top', '0px');
+ if ((this.$el.offset().left + width) > winWidth) {
+ this.$el.css('left', winWidth - width);
}
}

0 comments on commit e43f1f2

Please sign in to comment.