UNPKG

toloframework

Version:

Javascript/HTML/CSS compiler for Firefox OS or nodewebkit apps using modules in the nodejs style.

43 lines (34 loc) 979 B
/** @module wdg.label */require( 'wdg.label', function(exports, module) { var _intl_={"en":{}},_$=require("$").intl;function _(){return _$(_intl_, arguments);} /** * @module tfw.view.label * * @description * A simple label with a bindable property `label`. * * @example * var mod = require('tfw.view.label'); */ var $ = require("dom"); var DB = require("tfw.data-binding"); function Label( opts ) { var elem = $.elem( this, 'span', 'wdg-label' ); DB.prop(this, 'value')(function(v) { $.textOrHtml(elem, v); }); opts = DB.extend( { value: '', visible: true, wide: false }, opts, this ); } /** * @class tfw.view.label * @param {string} value - Text to display. If this text starts with * `<html>`, it is parsed as HTML code. */ module.exports = Label; module.exports._ = _; /** * @module wdg.label * @see module:$ * @see module:dom * @see module:tfw.data-binding * @see module:wdg.label */ });