1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: Storytelling (C) Copyright IBM Corp. 2018, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['./PlaceholderView', 'text!./TextPlaceholder.html', '../../util/TextFitUtil', '../../../app/nls/StringResources'], function (BaseClass, Template, TextFitUtil, stringResources) {
- var TextPlaceholderView = null;
- TextPlaceholderView = BaseClass.extend({
- templateString: Template,
- init: function init() {
- var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
- TextPlaceholderView.inherited('init', this, arguments);
- this.text = options.text || stringResources.get('textPlaceHolder');
- },
- render: function render() {
- var sHtml = this.dotTemplate({
- placeholderText: this.text
- });
- this.$el.append(sHtml);
- },
- show: function show() {
- TextPlaceholderView.inherited('show', this, arguments);
- this.fillText();
- },
- fillText: function fillText() {
- var node = this.el.querySelector('.placeholder.text');
- if (!node || node.style.display === 'none') {
- return;
- }
- node.classList.add('textFillNoScroll');
- var options = {
- maxFontSize: Math.ceil(node.clientHeight),
- minFontSize: 1,
- multiLine: false,
- detectMultiLine: false
- };
- TextFitUtil.fillText(node, options);
- }
- });
- return TextPlaceholderView;
- });
- //# sourceMappingURL=TextPlaceholderView.js.map
|