Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Conversation

@KynoYang
Copy link
Contributor

No description provided.

@KynoYang KynoYang closed this Jan 16, 2015
@wouldgo
Copy link
Member

wouldgo commented Jan 16, 2015

@45kb: LGTM

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here i don't like, sorry, the tooltip should inherit from title attribute :) or even better attr.tooltipTitle || attr.title i think

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I change it, because title is the attribute of html. If I use title, the default title will be showing at the same time of tooltip showing. For example,
image

It's really annoying.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok so better as i shown ;)

Just use attr.tooltipTitle || attr.title ... so that if tooltipTitle isn't available will inherit from title tag 💯

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, no problem.

@45kb
Copy link
Member

45kb commented Jan 16, 2015

@KynoYang thanks a lot for the PR, just see what i wrote between lines please so that we can merge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is something wrong with the caret style, i see tooltip content in lighter background color and caret is darker( caret is more black , content is more grey)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's my fault.
I add this because in our design, I need to set a border for the whole tooltip including the triangle. So, I use two triangle: the "before" one with larger size works as the border, the "after" one with smaller size works as the content. Just like what github does. You can check the style of github.
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok no problems just give to caret and content the same background ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are the same. The color of triangle is darker because of opacity.
How about set “after” no color? it makes the triangle look like what it is before.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes as it was before i think it was ok.

I liked a lot the "trasparent" replacement of rgba(0,0,0,0) you did, are we sure is it supported as well and even better than rgba()?

I tried searching a lot but no results, probably trasparent is fully supported since CSS1 so better than rgba() in such cases....

@45kb
Copy link
Member

45kb commented Jan 16, 2015

@KynoYang Ops, i didn't noticed you closed the PR, is this still valid/available?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, because in my project, the element which needs tooltip may change its position by mouse event. If the tooltip just init once, it will always stay in the position of first time showing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@45kb I also found a bug:
When I hover on the element, tooltip shows. However, if I click the element, (in my case the element will change its position) the tooltip doesn't change its position as long with the element.

I haven't solved this problem, do you have any idea?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good point and i didn't thought about it before, imho the easy way is to check somehow when the element moves on the screen and reinit tooltip, thank you

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So i would leave this part as it was before and try to check element movements somehow 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I think checking element movements costs more than initializing tooltip before showing. If you have better solution, let me know please.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is really heavy to catch, i agree, maybe some new attribute to specify or set when the element is going to move or change and so needs to be re-init ..... !?

Just an example:

<a tooltip tooltip-change="resize, mouseover, etc..."> I will change on resize and mouseover so re-init me when these events are fired </a>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know, resize event refers to window resize. It's not easy to know when an element resizing. 😢
Also, mouse events are not enough to detective elements movements.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok not a problem at all, time for a new attribute that solves our troubles:

<a tooltip tooltip-lazy="true/false"> Lazy re-init or not, just choose </a> So that if not in lazy mode you re-init everytime ....
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better! I'll do it right now.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thank you, just leave lazy mode by default ;)

@KynoYang KynoYang reopened this Jan 17, 2015
@KynoYang
Copy link
Contributor Author

@45kb done

@45kb
Copy link
Member

45kb commented Jan 17, 2015

@KynoYang great! so if you ready please commit to your repo fork so i can clone it and just test/see in browser all the changes, and we will merge it 💯

Many thanks!

@KynoYang
Copy link
Contributor Author

@45kb sorry. it's too late yesterday.
here is the repo https://github.com/KynoYang/angular-tooltips
the branch is for-beary
Thanks for your work.

45kb added a commit that referenced this pull request Jan 18, 2015
add class scope, re-init before showing, rich triangle
@45kb 45kb merged commit ade3ade into 720kb:master Jan 18, 2015
@45kb
Copy link
Member

45kb commented Jan 18, 2015

@KynoYang thanks for the PR and for your time, looks everything great! i will add changes to README and create new release with your changes, thank you

@45kb
Copy link
Member

45kb commented Jan 18, 2015

@KynoYang here the new version https://github.com/720kb/angular-tooltips/releases/tag/0.1.5 that you can install via bower to.

Thanks 👍

@KynoYang KynoYang deleted the for-beary branch January 19, 2015 03:43
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

3 participants