pkdevbox / simile-widgets

Automatically exported from code.google.com/p/simile-widgets
0 stars 0 forks source link

Timeline: Bug with CompactEventPainter.prototype._showBubble #300

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
If I try to extend OriginalEventPainter is all fine,
but with CompactEventPainter, it gives me an error 

Timeline.CompactEventPainter.prototype._showBubble = function(x, y, evt) {
            feid.innerHTML = evt.getID ();
                }

The evt is not returned by the prototype so, firebug reports:

  evt.getID is not a function

timeline v.2.3.0, windowsXP, Firefox 3.011

Original issue reported on code.google.com by litobyte...@gmail.com on 11 Jul 2009 at 1:59

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago

Here is my patch for timeline-bundle.js from line 785 to line 806:

basically you replace the four methods:
onClickInstantEvent, onClickMultiplePreciseInstantEvent onClickDurationEvent 
showBubble
In the CompactEventPainter prototype

////////////////////////////////// patch start - line 785

Timeline.CompactEventPainter.prototype._onClickMultiplePreciseInstantEvent=funct
ion(E,A,B){var
F=SimileAjax.DOM.getPageCoordinates(E);
this._showBubble(F.left+Math.ceil(E.offsetWidth/2),F.top+Math.ceil(E.offsetHeigh
t/2),B);
var D=[];
for(var C=0;
C<B.length;
C++){D.push(B[C].getID());
}this._fireOnSelect(D);
A.cancelBubble=true;
SimileAjax.DOM.cancelEvent(A);
return false;
};
Timeline.CompactEventPainter.prototype._onClickInstantEvent=function(C,A,B){var
D=SimileAjax.DOM.getPageCoordinates(C);
this._showBubble(D.left+Math.ceil(C.offsetWidth/2),D.top+Math.ceil(C.offsetHeigh
t/2),B);
this._fireOnSelect(B.getID());
A.cancelBubble=true;
SimileAjax.DOM.cancelEvent(A);
return false;
};
Timeline.CompactEventPainter.prototype._onClickDurationEvent=function(F,B,C){if(
"pageX"
in B){var A=B.pageX;
var E=B.pageY;
}else{var D=SimileAjax.DOM.getPageCoordinates(F);
var A=B.offsetX+D.left;
var E=B.offsetY+D.top;
}this._showBubble(A,E,C);
this._fireOnSelect(C.getID());
B.cancelBubble=true;
SimileAjax.DOM.cancelEvent(B);
return false;
};
Timeline.CompactEventPainter.prototype.showBubble=function(A){var
B=this._eventIdToElmt[A.getID()];
if(B){var C=SimileAjax.DOM.getPageCoordinates(B);
this._showBubble(C.left+B.offsetWidth/2,C.top+B.offsetHeight/2,A);
}};

//////////////////////////// patch ends line 806

It doesn't break the defeault Bubble behaviour, but it allows finally to extend 
the
method showBubble for CompactEventPainter??.

The difference was just the square brackets around the B and A where this 
letters are
the events passed. I removed them and written as they were in other Painters.

That's it. Bug gone.

Can somebody take this on ? I'm too lazy to checkout the file :-P

Original comment by litobyte...@gmail.com on 11 Jul 2009 at 4:15

GoogleCodeExporter commented 8 years ago
Hi,

Thank you for your time on this, but patches to the minimized software bundles 
are
really not of any use at all. Instead, please supply patches to the source code.

Thanks,
Larry

Original comment by larryklu...@gmail.com on 12 Jul 2009 at 1:47

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Well, you are right, but perhaps some end user came up with the same problem, 
and
this can be useful for him to fast fix the thing.

You mean I should submit the patch to the non minimized version in the trunk by
checking out the file ? 

Sorry for not getting it straight!

Original comment by litobyte...@gmail.com on 13 Jul 2009 at 1:14