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

Use of classList and #26

Closed spindi closed 11 years ago

spindi commented 11 years ago

I've noticed that the opentip-native-excanvas.js used classList. This causes huge IE issues 7/8/9. It also uses addEventListener.

Why do you say the plugin works for all browsers from IE7+ if this is the case?

Workaround for classList...

https://github.com/eligrey/classList.js

Workaround for addEventListener...

if (!this.unwrap(t).addEventListener) return this.unwrap(t).attachEvent(e,i); else return this.unwrap(t).addEventListener(e,i,!1);

enyo commented 11 years ago

Hi @spindi I'm sorry, I should have noted that the native version of opentip is not fully compatible with IE yet. If you need it, I can work on it and make it fully compatible (needs to be done anyway). Otherwise I suggest that you use the jquery adapter.

spindi commented 11 years ago

Aha ok. For the project I am hoping to use it in I unfortunately cannot use jQuery. But so far this is where I am at...

There is the above workaround for the classList - that is no problem to include. The addEventListener becomes...

if (this.unwrap(t).addEventListener) return this.unwrap(t).addEventListener(e,i,!1); else return this.unwrap(t).attachEvent('on' + e,i);

The removeEventListener becomes...

if (this.unwrap(t).removeEventListener) return this.unwrap(t).removeEventListener(e,i,!1); else return this.unwrap(t).detachEvent('on' + e, i);

But, still IE8 is giving me errors with a few of the returns...

return t instanceof NodeList?t=function(){var i,o,s;for(s=[],i=0,o=t.length;o>i;i++)e=t[i],s.push(e);return s}

Gives object expected. And...

return e={x:0,y:0},t==null&&(t=window.event),t!=null?(t.pageX||t.pageY?(e.x=t.pageX,e.y=t.pageY):(t.clientX||t.clientY)&&(e.x=t.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,e.y=t.clientY+document.body.scrollTop+document.documentElement.scrollTop),e):void 0},t.prototype.offset=function(t){var e;t=this.unwrap(t),e={top:t.offsetTop,left:t.offsetLeft};while(t=t.offsetParent)e.top+=t.offsetTop,e.left+=t.offsetLeft,t!==document.body&&(e.top-=t.scrollTop,e.left-=t.scrollLeft);return e},t.prototype.observe=function(t,e,i){

Gives member not found. I actually think it is pretty close to working though. If there is anything that you can do I would greatly appreciate it. The above recommendations and fixes should go in as soon as you can also.

Thanks :)

spindi commented 11 years ago

As far as I can see there is nothing else out there that can do this (without jQuery) (and look as good as Opentip). You would be blazing a path! :)

enyo commented 11 years ago

I'm on it! ;)

enyo commented 11 years ago

~1h

enyo commented 11 years ago

Is IE7 important to you? Or is it enough to support IE8?

spindi commented 11 years ago

IE8 is all that we support to.

On 31 jan 2013, at 17:39, Matias Meno notifications@github.com wrote:

Is IE7 important to you? Or is it enough to support IE8?

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

enyo commented 11 years ago

Should be fixed now: ded3f49d87