Skip to content

Commit

Permalink
Fixes #88 - StickyWin.UI with non-integer width options
Browse files Browse the repository at this point in the history
  • Loading branch information
anutron committed Apr 19, 2012
1 parent 4bb34fc commit e3d0f09
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Source/UI/StickyWin.UI.Pointy.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ StickyWin.UI.Pointy = new Class({

var w = opt.divotSize;
var h = w;
var left = (opt.width - opt.divotSize)/2;
var left = (opt.width.toInt() - opt.divotSize)/2;
var orient = function(){
switch(opt.direction) {
case 12: case 1: case 11:
Expand Down Expand Up @@ -221,7 +221,7 @@ StickyWin.UI.Pointy = new Class({
},
makeCaption: function(caption){
this.parent(caption);
if (this.options.width && this.h1) this.h1.setStyle('width', (this.options.width-(this.options.closeButton?25:15)));
if (this.options.width && this.h1) this.h1.setStyle('width', (this.options.width.toInt()-(this.options.closeButton?25:15)));
}
});

Expand Down
2 changes: 1 addition & 1 deletion Source/UI/StickyWin.UI.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ StickyWin.UI = new Class({
if (!caption) return this.destroyCaption();
var opt = this.options;
this.h1 = new Element('h1').addClass('caption');
if (opt.width) this.h1.setStyle('width', (opt.width-(opt.cornerHandle?55:40)-(opt.closeButton?10:0)));
if (opt.width) this.h1.setStyle('width', (opt.width.toInt()-(opt.cornerHandle?55:40)-(opt.closeButton?10:0)));
this.setCaption(caption);
this.top_ur.adopt(this.h1);
if (!this.options.cornerHandle) this.h1.addClass('dragHandle');
Expand Down

0 comments on commit e3d0f09

Please sign in to comment.