Class Index | File Index

Classes


Function Namespace Pot.Signal.attachPropAfter


Defined in: <potlite.js>.

Function Namespace Summary
Constructor Attributes Constructor Name and Description
 
Pot.Signal.attachPropAfter(object, signalName, callback, (useCapture), (once))
Attaches a signal to a slot on after, and return a handler object as a unique identifier that can be used to detach that signal.
Method Summary
Method Attributes Method Name and Description
<static>  
Pot.Signal.attachPropAfter.once(object, signalName, callback, (useCapture))
Similar to attach*(), but detaches the signal handler automatically once it has fired.
Function Namespace Detail
Pot.Signal.attachPropAfter(object, signalName, callback, (useCapture), (once))
Attaches a signal to a slot on after, and return a handler object as a unique identifier that can be used to detach that signal. When method is called, this callback will be triggered.
  // Example code for add callback to the
  //  Object direct like aspect settings.
  var MyApp = {
    execute : function() {
      // Begin something process.
      myAppDoit();
    }
  };
  attach('#execute', 'click', function() {
    // Execute Application.
    MyApp.execute();
  });
  // Add a logging callback function before execution.
  attachPropBefore(MyApp, 'execute', function() {
    MyLogger.log('Begin execute');
  });
  // Add a logging callback function after execution.
  attachPropAfter(MyApp, 'execute', function() {
    MyLogger.log('End execute');
  });
Parameters:
{Object|Function|String} object
The object that be target of the signal. If passed in a string then will be a HTML element by document.getElementById.
{String|Array} signalName
`signalName` is a string that represents a signal name. If `object` is a DOM object then it can be specify one of the 'onxxx' native events. That case 'on' prefix is optionally.
{Function} callback
An action to take when the signal is triggered.
{Boolean} (useCapture)
(Optional) `useCapture` will passed its 3rd argument to addEventListener if environment is available it on DOM.
{Boolean} (once)
(Optional) Only internal usage.
Returns:
{Object|Array} Return an instance of Pot.Signal.Handler object as a unique identifier that can be used to detach that signal.
Method Detail
<static> {Function} Pot.Signal.attachPropAfter.once(object, signalName, callback, (useCapture))
Similar to attach*(), but detaches the signal handler automatically once it has fired.
  attachPropAfter.once(MyObj, 'initialize', function() {
    alert('This message will show only once.');
  });
Parameters:
{Object|Function|String} object
The object that be target of the signal. If passed in a string then will be a HTML element by document.getElementById.
{String} signalName
`signalName` is a string that represents a signal name. If `object` is a DOM object then it can be specify one of the 'onxxx' native events. That case 'on' prefix is optionally.
{Function} callback
An action to take when the signal is triggered.
{Boolean} (useCapture)
(Optional) `useCapture` will passed its 3rd argument to addEventListener if environment is available it on DOM.
Returns:
{Object} Return an instance of Pot.Signal.Handler object as a unique identifier that can be used to detach that signal.

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Sep 21 2012 19:35:45 GMT+0900 (JST)