Last Comment Bug 795518 - content api for closing panels
: content api for closing panels
Status: RESOLVED FIXED
[Fx17]
:
Product: Firefox
Classification: Client Software
Component: SocialAPI (show other bugs)
: Trunk
: All All
: -- normal (vote)
: Firefox 18
Assigned To: Mark Hammond [:markh]
:
: Shane Caraveo (:mixedpuppy)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-28 16:51 PDT by Shane Caraveo (:mixedpuppy)
Modified: 2012-10-02 18:22 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---
+
fixed


Attachments
Have window.close() close panels and chats (6.15 KB, patch)
2012-10-01 19:14 PDT, Mark Hammond [:markh]
jaws: review+
gavin.sharp: approval‑mozilla‑aurora+
Details | Diff | Splinter Review

Description Shane Caraveo (:mixedpuppy) 2012-09-28 16:51:46 PDT
social panels (flyout, status and chat) need an api for closing the panel.  One was implemented for flyouts, it should be updated or verified to work with the panel that is calling the api.
Comment 1 Shane Caraveo (:mixedpuppy) 2012-09-28 16:52:14 PDT
This is related to but not dependent on bug 794640
Comment 2 Mark Hammond [:markh] 2012-10-01 02:03:15 PDT
On IRC, Jaws suggested we just use window.close.  I've a patch which uses the DOMWindowClose event to implement this (no tests and no support for chat windows yet) - but what d'ya reckon?
Comment 3 Shane Caraveo (:mixedpuppy) 2012-10-01 08:46:24 PDT
cool, I would much prefer window.close.  iirc we pass back the window object on any opening api.
Comment 4 Mark Hammond [:markh] 2012-10-01 19:14:22 PDT
Created attachment 666805 [details] [diff] [review]
Have window.close() close panels and chats

window.close(), when used on a chatbar window or a panel window will close the chat/panel.
Comment 5 Jared Wein [:jaws] (please needinfo? me) 2012-10-01 21:07:40 PDT
Comment on attachment 666805 [details] [diff] [review]
Have window.close() close panels and chats

Review of attachment 666805 [details] [diff] [review]:
-----------------------------------------------------------------

::: toolkit/components/social/MozSocialAPI.jsm
@@ +174,4 @@
>      // set a timer which will fire after the unload events have all fired.
>      schedule(function () { port.close(); });
>    });
> +  targetWindow.addEventListener("DOMWindowClose", function(evt) {

Please name this function and remove the event listener.
Comment 6 Mark Hammond [:markh] 2012-10-02 00:59:10 PDT
As discussed on IRC, the listener can't be removed as it might fire multiple times.

https://hg.mozilla.org/integration/mozilla-inbound/rev/3b58a62ebfd9
Comment 7 Ed Morley [:emorley] 2012-10-02 08:57:39 PDT
https://hg.mozilla.org/mozilla-central/rev/3b58a62ebfd9
Comment 8 :Gavin Sharp [email: gavin@gavinsharp.com] 2012-10-02 18:22:00 PDT
https://hg.mozilla.org/releases/mozilla-aurora/rev/94b299dc86b0

Note You need to log in before you can comment on or make changes to this bug.