Open Bug 734072 Opened 12 years ago Updated 2 years ago

Allow tooltips to be clicked on (i.e Attendees, URL)

Categories

(Calendar :: Calendar Frontend, defect)

defect

Tracking

(Not tracked)

People

(Reporter: Fallen, Unassigned, Mentored)

Details

(Keywords: good-first-bug, Whiteboard: [lang=js])

The item tooltips sometimes contains actionable content, like an URL or Attendee. To save the user from needing to open the event dialog every time, we could make tooltips stay a bit longer:

When the user hovers over an item with tooltip, the tooltip should open and should not go away until the user moves the mouse to an other element outside of the tooltip itself.

To describe it with other terms, the user can hover over the element, then move the mouse onto the tooltip to click on something and the tooltip will only disappear when the user moves the mouse away from the tooltip.

This might require a bit of manual work since the normal tooltips are not made to stay shown. This either means fixing nsXULTooltipListener.cpp to allow this (which would rock!), or working around by implementing the tooltip logic on our own.

This snippet kind of does what we need, paste it in xuledit to test! This code needs to be generalized so it can be used by any element that wants this kind of tooltip.

<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<window id="yourwindow"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

<script type="application/javascript">
function omout_tt(event) {
  if (!event.relatedTarget) event.target.hidePopup();
}
function omover_lbl(event) {
  event.target.timer = setTimeout(function() { document.getElementById('foo').openPopup(event.target) }, 500);
}
function omout_lbl(event) {
  clearTimeout(event.target.timer);
}
</script>

<tooltip noautohide="true" id="foo" width="100" height="100"
         onmouseout="omout_tt(event)">
  <label id="ila" class="text-link" href="http://example.com/">foo</label>
</tooltip>

<label onmouseover="omover_lbl(event)" onmouseout="omout_lbl(event)">
  fooo
</label>
</window>


If this is solved in JS, then it could turn out to be a [good first bug]. If you happen to know C++, go ahead and take a stab at fixing this in C++. The relevant file is here:

http://mxr.mozilla.org/comm-central/source/mozilla/layout/xul/base/src/nsXULTooltipListener.cpp
Assignee: nobody → santom91
Status: NEW → ASSIGNED
Santom, still interested in this bug?
Cross-reference: bug 553132.
Can you confirm that you're still working on this bug?
Flags: needinfo?(santom91)
We have a new interested contributor willing to take a look at this bug. Welcome!
Assignee: santom91 → himani93
Flags: needinfo?(santom91)
Mentor: philipp
Whiteboard: [good first bug][mentor=Fallen][lang=js] → [good first bug][lang=js]
I would like to take this bug up. Is there any related js file ?
Hi, Manu - Thanks for your interest! Let's confirm with Philipp.

Philipp - is this still a good candidate for a first bug?
Flags: needinfo?(philipp)
Yes, this should still be a good candidate. In addition to what I mentioned in comment 0, it might be worth experimenting with preventing the popuphiding event, or using a <panel noautohide="true"> instead of a tooltip as the base element.

The most important thing here is to make it feel like a normal tooltip to the user, but allowing clicks. This means for example that the tooltip should not stick when the user accidentally hovers over an element or should go away when the user tries to get rid of it by clicking elsewhere.

Once you've created your patch, start Thunderbird and pretend you are a user not a developer. Go through a few use cases thinking...what would the user do?

If you have questions, feel free to ping me on IRC or comment here.
Assignee: himani93 → manu.jain13
Flags: needinfo?(philipp)
As I mentioned in bug 553132, I'm happy to test, Manu. Thanks for stepping up for this one.
Ok Manu, you're up to bat. Thanks for taking this up, and if you've got any questions don't hesitate to ask. Use the "needinfo" flag (below this box) to call attention to your q
...to call attention to your questions by choosing "mentor" from the pulldown menu. And good luck!
Keywords: good-first-bug
Whiteboard: [good first bug][lang=js] → [lang=js]
Assignee: manu.jain13 → nobody
Status: ASSIGNED → NEW
Version: Trunk → unspecified

Hey,i wish to work on this bug

I would like to work on this bug if it is still available

Hello, I am an outreachy applicant. Can I work on this bug?

Hello, I would like to work on this bug.

Thanks

Can you assign this to me? I want to work on it.

Flags: needinfo?(philipp)

hi, Is this bug still open. Can you assign it to me ? I would love to work on it.

We typically assign bugs to new contributors once they've put up a preliminary patch for them. You're welcome to give it a try, and thank you for your interest!

Flags: needinfo?(philipp)
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.