Permalink
Browse files

Fixes #88 - StickyWin.UI with non-integer width options

  • Loading branch information...
1 parent 4bb34fc commit e3d0f09bec18b4428f535168810c1b5a8cfd7b1a @anutron committed Apr 19, 2012
Showing with 3 additions and 3 deletions.
  1. +2 −2 Source/UI/StickyWin.UI.Pointy.js
  2. +1 −1 Source/UI/StickyWin.UI.js
@@ -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:
@@ -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)));
}
});
@@ -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');

0 comments on commit e3d0f09

Please sign in to comment.