/* global document */
/** @constructor */
'use strict';
var _get = require('babel-runtime/helpers/get')['default'];
var _inherits = require('babel-runtime/helpers/inherits')['default'];
var _classCallCheck = require('babel-runtime/helpers/class-call-check')['default'];
var _Object$keys = require('babel-runtime/core-js/object/keys')['default'];
var Element = /** @function
* @param element */function Element(element) {
this[0] = element;
element.$elt = this;
element.addEventListener('dispose', ( /** @function */function () {
setTimeout(( /** @function */function () {
// allow other dispose event listeners
this[0].$elt = undefined; // ie does not allow deletion of properties on elements.
delete this[0].$elt;
_Object$keys(this).forEach(( /** @function
* @param key */function (key) {
delete this[key];
}).bind(this));
}).bind(this), 1);
}).bind(this), false);
};
module.exports = Element;
var elements = require('./elements');
Element.prototype = {
/**
* Set value
*
* @param {string} value
* @return {Element}
*/
setValue: /** @function
* @param value */function setValue(value) {
elements.setValue(this[0], value);
return this;
}
};
/** @class ElementBasic
* @param tagName */
var ElementBasic = (function (_Element) {
_inherits(ElementBasic, _Element);
function ElementBasic(tagName) {
_classCallCheck(this, ElementBasic);
_get(Object.getPrototypeOf(ElementBasic.prototype), 'constructor', this).call(this, document.createElement(tagName));
}
/**
* @constructor
* @augments {Element}
* @param {string} tagName
*/
return ElementBasic;
})(Element);
Element.Basic = ElementBasic;
/**
* @constructor
* @augments {Element}
* @param {string} tagName
*/
Element.WithContent = Element.Basic;
//# sourceMappingURL=element.js.map |