ucsd-cse112/team13

View on GitHub
docs/api/core-link_CoreLinkElement.js.html

Summary

Maintainability
Test Coverage
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Source: core-link/CoreLinkElement.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: core-link/CoreLinkElement.js</h1>

    



    
    <section>
        <article>
            <pre class="prettyprint source linenums"><code>import CoreElement from '../core-element/CoreElement';

import TEMPLATE from './CoreLinkElement.html';
import STYLE from './CoreLinkElement.css';

const CoreLinkTemplate = CoreElement.templateNode(TEMPLATE, STYLE);

/**
 * An element that allows the user to go to a link, with style.
 * @property {String} href          the link to go to
 * @property {String} type          the type of link; these include primary, success, warning,
 *                                  danger, or info
 * @property {Boolean} disabled     whether the link is disabled
 * @property {Boolean} underline    whether the link has an underline
 */
class CoreLinkElement extends CoreElement {
  /** @private */
  static get properties() {
    return {
      href: { type: String },
      type: { type: String },
      disabled: { type: Boolean },
      underline: { type: Boolean },
    };
  }

  /** Constructs the core-link element with the template and style */
  constructor() {
    super(CoreLinkTemplate);

    this.linkElement = this.shadowRoot.querySelector('#link');
    this.linkSlot = this.shadowRoot.querySelector('#link-content');
  }

  /** @private */
  propertyChangedCallback(property, oldValue, newValue) {
    switch (property) {
      case 'href':
        this.linkElement.href = newValue;
        break;
      case 'disabled':
        this.linkElement.disabled = newValue;
        break;
      default:
    }
  }
}
CoreElement.customTag('core-link', CoreLinkElement);

export default CoreLinkElement;
</code></pre>
        </article>
    </section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-CoreElement.html">CoreElement</a></li></ul><h3>Classes</h3><ul><li><a href="CoreByeElement.html">CoreByeElement</a></li><li><a href="CoreGreetElement.html">CoreGreetElement</a></li><li><a href="CoreHelloElement.html">CoreHelloElement</a></li><li><a href="CoreLinkElement.html">CoreLinkElement</a></li><li><a href="CoreSliderElement.html">CoreSliderElement</a></li><li><a href="CoreTooltipElement.html">CoreTooltipElement</a></li><li><a href="module-CoreElement-CoreElement.html">CoreElement</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.2</a> on Thu Jun 13 2019 18:17:43 GMT-0700 (Pacific Daylight Time)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>