enyo / opentip

Opentip is an open source javascript tooltip based on the protoype framework.
http://www.opentip.org
1.25k stars 401 forks source link

AjaxCache property #24

Closed marcogrosseto closed 11 years ago

marcogrosseto commented 11 years ago

Hi,

I'm trying to use the attribute ajaxCahce but it seems to doesn't work fine. I've tried this

data-ot-ajaxCache="false"

but the conent of the tool tip is downloaded just once.

Such suggestion ?

thanks

Marco

enyo commented 11 years ago

I'll look into it tomorrow! Can't today. Sorry

enyo commented 11 years ago

Oh... At first glance your html attribute is wrong. It should be: data-ot-ajax-cache. All option properties in html attributes are "dasherized". I hope this fixes your problem. Please report back.

marcogrosseto commented 11 years ago

thanks for the answer but it doesn't work yet.

I'll try using prototype in order to bind tool tip to the object in the meanwhile

enyo commented 11 years ago

That's strange... it should work like this. Please tell me if the setup with prototype works. If it does, there must be something wrong with your html attribute setup (or in my code parsing it).

If it doesn't work with prototype as well, I'll have to investigate.

marcogrosseto commented 11 years ago

I'll do it

marcogrosseto commented 11 years ago

I,ve tried but It doesn't work with Prototype as well.I mean that AJAX call is well done just once

enyo commented 11 years ago

Sorry to not have replied. Did you fix your problem? Are you still having the same issue?

marcogrosseto commented 11 years ago

Nope,

unluckly the Ajax call work fine just once ... after that the server doesn't recive nothing and it's too hard for my understand why opentip doesn't make the AJAX call twice. I've tried with prototype as well.

2013/1/29 Matias Meno notifications@github.com

Sorry to not have replied. Did you fix your problem? Are you still having the same issue?

— Reply to this email directly or view it on GitHubhttps://github.com/enyo/opentip/issues/24#issuecomment-12855324.

enyo commented 11 years ago

Do you have a public site where I can check it out?

marcogrosseto commented 11 years ago

No, it is an intranet application.

Today I'm quite busy and I can't help you more. Tomorrow I'll try to provide you other information. Could be a problem with the server side code. I'm using spring webflow.

2013/1/30 Matias Meno notifications@github.com

Do you have a public site where I can check it out?

— Reply to this email directly or view it on GitHubhttps://github.com/enyo/opentip/issues/24#issuecomment-12884610.

enyo commented 11 years ago

Hi Marco. I've tested it, and also improved the way AJAX gets loaded (3b2fa32 and cf47294ba5) but couldn't reproduce your problem. If you send me some more information I can look into it. I'm closing the issue for now.

marcogrosseto commented 11 years ago

Hi Matias,

sorry for the dealy ...

Today I've found time to go deep inside the opentip-prototype.js code and changing line 152 :

return this._abortHiding(), this._clearTimeouts(), this.visible ? void 0 : this._triggerElementExists() ? (this.debug("Showing now."), this.options.group && t._hideGroup(this.options.group, this), this.visible = !0, this.preparingToShow = !1, this.tooltipElement == null && this._buildElements(), this._updateElementContent(), !this.options.ajax || this.loaded && this.options.ajaxCache || this._loadAjax(), this._searchAndActivateCloseButtons(), this._startEnsureTriggerElement(), this.adapter.css(this.container, {

in

return this._abortHiding(), this._clearTimeouts(), this.visible ? void 0 : this._triggerElementExists() ? (this.debug("Showing now."), this.options.group && t._hideGroup(this.options.group, this), this.visible = !0, this.preparingToShow = !1, this.tooltipElement == null && this._buildElements(), this._updateElementContent(), !this.options.ajax || this._loadAjax(), this._searchAndActivateCloseButtons(), this._startEnsureTriggerElement(), this.adapter.css(this.container, {

so deleting (this.loaded && this.options.ajaxCache ||)

and changing line 312 the function - t.prototype._loadAjax = function () :

url: this.options.ajax ,

in

url: this.options.ajax + '?random='+ Math.floor((Math.random()*100)+1),

I've achieved my aim. Maybe it isn't your idea but if this can help you in some way I'm glad.

Now, each time I pass the arrow of the mouse over the object with the tip, I see a call to the Controller (I work with spring web-flow).

have a nice day

Marco

2013/2/17 Matias Meno notifications@github.com

Hi Marco. I've tested it, and also improved the way AJAX gets loaded ( 3b2fa32 https://github.com/enyo/opentip/commit/3b2fa32 and cf47294https://github.com/enyo/opentip/commit/cf47294ba5) but couldn't reproduce your problem. If you send me some more information I can look into it. I'm closing the issue for now.

— Reply to this email directly or view it on GitHubhttps://github.com/enyo/opentip/issues/24#issuecomment-13687666.