Skip to content

Commit

Permalink
* Fixing Tips (again!) From now on no one touches this plugin without…
Browse files Browse the repository at this point in the history
… my approval.
  • Loading branch information
cpojer committed Feb 10, 2010
1 parent 6278d79 commit 41870cb
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions Source/Interface/Tips.js
Expand Up @@ -61,6 +61,7 @@ this.Tips = new Class({
var params = Array.link(arguments, {options: Object.type, elements: $defined});
this.setOptions(params.options);
if (params.elements) this.attach(params.elements);
this.toElement();
},

toElement: function(){
Expand Down Expand Up @@ -132,7 +133,7 @@ this.Tips = new Class({
$clear(this.timer);
this.timer = (function(){
this.show(this, element);
this.position((this.options.fixed) ? {page: element.getPosition()} : event);
this.position(this.options.fixed ? {page: element.getPosition()} : event);
}).delay(this.options.showDelay, this);
},

Expand All @@ -154,9 +155,8 @@ this.Tips = new Class({
},

position: function(event){
if (!this.tip) document.id(this);

var size = window.getSize(), scroll = window.getScroll(),
var size = window.getSize(),
scroll = window.getScroll(),
tip = {x: this.tip.offsetWidth, y: this.tip.offsetHeight},
props = {x: 'left', y: 'top'},
obj = {};
Expand All @@ -175,12 +175,10 @@ this.Tips = new Class({
},

show: function(element){
if (!this.tip) document.id(this);
this.fireEvent('show', [this.tip, element]);
},

hide: function(element){
if (!this.tip) document.id(this);
this.fireEvent('hide', [this.tip, element]);
}

Expand Down

0 comments on commit 41870cb

Please sign in to comment.