preReadyNotifQueue = [];
/**
- * Creates a Notification object for 1 message.
- * Does not insert anything into the document (see #start).
+ * A Notification object for 1 message.
*
- * The "_" in the name is to avoid a bug (http://github.com/senchalabs/jsduck/issues/304)
+ * The "_" in the name is to avoid a bug (http://github.com/senchalabs/jsduck/issues/304).
* It is not part of the actual class name.
*
* @class mw.Notification_
* @alternateClassName mw.Notification
- * @private
*
- * @constructor
+ * @constructor The constructor is not publicly accessible; use mw.notification#notify instead.
+ * This does not insert anything into the document (see #start).
+ * @private
*/
function Notification( message, options ) {
var $notification, $notificationTitle, $notificationContent;
}
/**
- * Start the notification.
- * This inserts it into the page, closes any matching tagged notifications,
- * handles the fadeIn animations and repacement transitions, and starts autoHide timers.
+ * Start the notification. Called automatically by mw.notification#notify
+ * (possibly asynchronously on document-ready).
+ *
+ * This inserts the notification into the page, closes any matching tagged notifications,
+ * handles the fadeIn animations and replacement transitions, and starts autoHide timers.
+ *
+ * @private
*/
Notification.prototype.start = function () {
var
* Close/hide the notification.
*
* @param {Object} options An object containing options for the closing of the notification.
- * These are typically only used internally.
*
* - speed: Use a close speed different than the default 'slow'.
* - placeholder: Set to false to disable the placeholder transition.
* Helper function, take a list of notification divs and call
* a function on the Notification instance attached to them.
*
+ * @private
+ * @static
* @param {jQuery} $notifications A jQuery object containing notification divs
* @param {string} fn The name of the function to call on the Notification instance
*/
* @param {HTMLElement|jQuery|mw.Message|string} message
* @param {Object} options The options to use for the notification.
* See #defaults for details.
- * @return {Object} Object with a close function to close the notification
+ * @return {mw.Notification} Notification object
*/
notify: function ( message, options ) {
var notif;
} else {
preReadyNotifQueue.push( notif );
}
- return { close: $.proxy( notif.close, notif ) };
+
+ return notif;
},
/**