| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 | <!DOCTYPE html><html lang="en"><head>    <meta charset="utf-8">    <title>JSDoc: Source: EventArgs.js</title>    <script src="scripts/prettify/prettify.js"> </script>    <script src="scripts/prettify/lang-css.js"> </script>    <!--[if lt IE 9]>      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>    <![endif]-->    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"></head><body><div id="main">    <h1 class="page-title">Source: EventArgs.js</h1>            <section>        <article>            <pre class="prettyprint source linenums"><code>// Licensed Materials - Property of IBM//// IBM Watson Analytics//// (C) Copyright IBM Corp. 2015//// US Government Users Restricted Rights - Use, duplication or// disclosure restricted by GSA ADP Schedule Contract with IBM Corp.module.exports = ( function( decl ){"use strict";/** * Create new EventArgs. Allows specifying a cancelable parameter as optional argument, which defaults to false. * @class module:barejs.EventArgs * @param {boolean} [_cancelable] Optional: provide a boolean to set whether this event is cancelable (default: prototype value, which is false for EventArgs). * @classdesc Base class for event arguments. Mimics html events cancelable behavior for events that have default behavior that can be canceled. * Subclasses can set the cancelable flag on their prototype, or use EventArgs.call( this, true ) to propagate the cancelable flag. */function EventArgs( /*cancelable*/ ){    decl.defineProperties( this,    {        // Fixate the cancelable property for this object, either to argument 0 or the prototype value        cancelable: { enumerable: true, value: ( typeof arguments[0] === "boolean" ? arguments[0] : this.cancelable === true ) },        // Set defaultPrevented to false        defaultPrevented: { configurable: true, enumerable: true, value: false }    } );}return decl.declareClass( EventArgs,/** @lends module:barejs.EventArgs# */{    /**     * This value is true if the event got canceled (preventDefault was called, and cancelable is true).     * @member {boolean}     * @readonly     */    defaultPrevented: { enumerable: true, value: null },    /**     * The cancelable flag determines whether this event has behavior that can be canceled.     * @member {boolean}     * @readonly     */    cancelable: { enumerable: true, writable: true, value: false },    /**     * The preventDefault method will flag the EventArgs as defaultPrevented, if cancelable is true.     * @function     */    preventDefault:    {        enumerable: true,        value: function preventDefault()        {            if ( ( this.cancelable === true ) && !this.defaultPrevented )                decl.defineProperty( this, "defaultPrevented", { enumerable: true, value: true } );        }    }} );// End of define}( require( "./decl" ) ) );</code></pre>        </article>    </section></div><nav>    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-barejs.html">barejs</a></li><li><a href="module-barejs_polyfill.html">barejs/polyfill</a></li><li><a href="module-barejs_polyfill_Intl.html">barejs/polyfill/Intl</a></li></ul><h3>Classes</h3><ul><li><a href="module-barejs.decl.html">decl</a></li><li><a href="module-barejs.decl-Enum.html">Enum</a></li><li><a href="module-barejs.decl-Interface.html">Interface</a></li><li><a href="module-barejs.decl-SpecialType.html">SpecialType</a></li><li><a href="module-barejs.Destroyable.html">Destroyable</a></li><li><a href="module-barejs.EventArgs.html">EventArgs</a></li><li><a href="module-barejs.Evented.html">Evented</a></li><li><a href="module-barejs.Evented-EventedHandle.html">EventedHandle</a></li><li><a href="module-barejs.Exception.html">Exception</a></li><li><a href="module-barejs_polyfill.Array.html">Array</a></li><li><a href="module-barejs_polyfill.Date.html">Date</a></li><li><a href="module-barejs_polyfill.EntryStore.html">EntryStore</a></li><li><a href="module-barejs_polyfill.EntryStore.Iterator.html">Iterator</a></li><li><a href="module-barejs_polyfill.Function.html">Function</a></li><li><a href="module-barejs_polyfill.Map.html">Map</a></li><li><a href="module-barejs_polyfill.Map-MapIterator.html">MapIterator</a></li><li><a href="module-barejs_polyfill.Math.html">Math</a></li><li><a href="module-barejs_polyfill.Number.html">Number</a></li><li><a href="module-barejs_polyfill.Object.html">Object</a></li><li><a href="module-barejs_polyfill.Promise.html">Promise</a></li><li><a href="module-barejs_polyfill.Set.html">Set</a></li><li><a href="module-barejs_polyfill.Set-SetIterator.html">SetIterator</a></li><li><a href="module-barejs_polyfill.String.html">String</a></li><li><a href="module-barejs_polyfill.Symbol.html">Symbol</a></li><li><a href="module-barejs_polyfill.WeakMap.html">WeakMap</a></li><li><a href="module-barejs_polyfill.WeakSet.html">WeakSet</a></li><li><a href="module-barejs_polyfill_Intl.DateTimeFormat.html">DateTimeFormat</a></li><li><a href="module-barejs_polyfill_Intl.DateTimeFormat-DateTimeFormatOptions.html">DateTimeFormatOptions</a></li><li><a href="module-barejs_polyfill_Intl.NumberFormat.html">NumberFormat</a></li><li><a href="module-barejs_polyfill_Intl.NumberFormat-NumberFormatOptions.html">NumberFormatOptions</a></li><li><a href="module-barejs_polyfill_Intl-Format.html">Format</a></li></ul></nav><br class="clear"><footer>    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Wed Oct 03 2018 15:59:33 GMT+0200 (W. Europe Daylight Time)</footer><script> prettyPrint(); </script><script src="scripts/linenumber.js"> </script></body></html>
 |