| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- /**
- * @module ui/label/labelview
- */
- import View from '../view';
- import '../../theme/components/label/label.css';
- /**
- * The label view class.
- *
- * @extends module:ui/view~View
- */
- export default class LabelView extends View {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * The text of the label.
- *
- * @observable
- * @member {String} #text
- */
- this.set( 'text' );
- /**
- * The `for` attribute of the label (i.e. to pair with an `<input>` element).
- *
- * @observable
- * @member {String} #for
- */
- this.set( 'for' );
- const bind = this.bindTemplate;
- this.setTemplate( {
- tag: 'label',
- attributes: {
- class: [
- 'ck-label'
- ],
- for: bind.to( 'for' )
- },
- children: [
- {
- text: bind.to( 'text' )
- }
- ]
- } );
- }
- }
|