Closed Bug 686626 Opened 13 years ago Closed 1 year ago

Timeout is not functioning in popup notification.

Categories

(Toolkit :: PopupNotifications and Notification Bars, defect, P5)

x86
Windows XP
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: kart2006, Unassigned)

Details

Attachments

(1 file)

Attached image stack.jpg
User Agent: Mozilla/5.0 (Windows NT 5.1; rv:6.0) Gecko/20100101 Firefox/6.0 Build ID: 20110811165603 Steps to reproduce: This code working for me to display the door-hanger popup. But, when I want to use the time-out under the options it wont show up the pop-up notification. Syntax: Notification show(browser,id,message,anchorID,mainAction,secondaryActions,options); My code: PopupNotifications.show(gBrowser.selectedBrowser, "PDE-popup", "Hi, there!, You can Build a PaDE by clicking on the PDE button!!", null, /* anchor ID */ { label: "Build PDE", accessKey: "D", callback: function() { if(nodeSRC!=null) pde.emptyNodeSRC(nodeSRC); window.openDialog("chrome://PDE/content/PDEBuilder.xul", "hello", "chrome,width=400,height=360",userContent, nodeSRC); } },null, { timeout: Date.now() + 10000, persistWhileVisible: false }); I have no secondary options so, I made it null but the time-out is not functioning. <http://scenari-platform.org/svn/dev-core/trunk/Lib_XulRunner/Darwin/modules/PopupNotifications.jsm> <https://developer.mozilla.org/en/JavaScript_code_modules/PopupNotifications.jsm#Notification_events> Actual results: The door hanger pop-up must disappear in 10seconds but it didn't. Then I changed the code slightly in this way: { timeout: 10000, persistWhileVisible: false } still the pop-up wont disappear in 10 seconds. Expected results: The pop-up should disappear in 10 seconds according to the explanation given in the websites(links are added in the top box).
Severity: normal → major
Priority: -- → P5
Maybe you misunderstood "timeout". The popup does not dismiss before timeout by locationchange notification. if timeout is not specified, the popup disappears automatically by locationchange notification.
Your right. My problem is the 'timeout' isn't working. { timeout: Date.now() + 1000, persistWhileVisible: false } - the pop-up didn''t hide in 1 second { timeout: 1000, persistWhileVisible: false } - this way, the pop-up didn't disappear in 1 second. I don't find any code for the timeout in the website except some explanation.
Finally I have mu Solution: Components.utils.import('resource://app/modules/PopupNotifications.jsm'); var notify = new PopupNotifications(gBrowser, document.getElementById("notification-popup"), document.getElementById("notification-popup-box")); var notification = notify.show( gBrowser.selectedBrowser, /*browser*/ "PDES-popup", /*id*/ "Hi, there!, You can build by clicking here!!",/*message*/ null, /* anchor ID */ /* mainAction */ { label: "Build Letter", accessKey: "D", callback: function() { if(nodeSRC!=null) pde.emptyNodeSRC(nodeSRC); window.openDialog("chrome://Build/content/Builder.xul", "hello", "chrome,width=400,height=360",userContent, nodeSRC); } }, null, /* secondaryActions*/ { blablal:'options'} ); setTimeout(function(){ notification.remove(); }, 400); Please update the documents properly because in this link it says https://developer.mozilla.org/en/JavaSc ... ations.jsm; the popup notification module is not require to import to have all the function related to "popup notification" but it didn't work as it is explained in the website. If some one wants to have a timeout function, they have to define everything the way I have mentioned here. I do, updated this code in the website. Thank you and please close this bug thread. Please make sure the timeout will work as it's explained or please update the document properly.
Component: General → Notifications and Alerts
Product: Firefox → Toolkit
Version: 6 Branch → unspecified

In the process of migrating remaining bugs to the new severity system, the severity for this bug cannot be automatically determined. Please retriage this bug using the new severity system.

Severity: major → --
Component: Notifications and Alerts → PopupNotifications and Notification Bars

Popupnotifications still support a timeout option, but it seems intended to specify a time before which the popup cannot be automatically dismissed, rather than a time at which the popup will be dismissed. The later case seems to be what the reporter was expecting to happen, which feels like a misunderstanding as suggested in comment 1.

Status: UNCONFIRMED → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: