| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- /**
- * @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
- * For licensing, see LICENSE.md.
- */
- /**
- * @module ui/tooltip/tooltipview
- */
- import View from '../view';
- import Template from '../template';
- /**
- * The tooltip view class.
- *
- * @extends module:ui/view~View
- */
- export default class TooltipView extends View {
- /**
- * @inheritDoc
- */
- constructor( locale ) {
- super( locale );
- /**
- * The text of the tooltip visible to the user.
- *
- * @observable
- * @member {String} #text
- */
- this.set( 'text' );
- /**
- * The position of the tooltip (south or north).
- *
- * +-----------+
- * | north |
- * +-----------+
- * V
- * [element]
- *
- * [element]
- * ^
- * +-----------+
- * | south |
- * +-----------+
- *
- * @observable
- * @default 's'
- * @member {'s'|'n'} #position
- */
- this.set( 'position', 's' );
- const bind = this.bindTemplate;
- this.template = new Template( {
- tag: 'span',
- attributes: {
- class: [
- 'ck-tooltip',
- bind.to( 'position', position => 'ck-tooltip_' + position )
- ]
- },
- children: [
- {
- tag: 'span',
- attributes: {
- class: [
- 'ck-tooltip__text'
- ]
- },
- children: [
- {
- text: bind.to( 'text' ),
- }
- ]
- }
- ]
- } );
- }
- }
|