Text.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. "use strict";
  2. /*
  3. *+------------------------------------------------------------------------+
  4. *| Licensed Materials - Property of IBM
  5. *| IBM Cognos Products: Content Explorer
  6. *| (C) Copyright IBM Corp. 2015, 2017
  7. *|
  8. *| US Government Users Restricted Rights - Use, duplication or disclosure
  9. *| restricted by GSA ADP Schedule Contract with IBM Corp.
  10. *+------------------------------------------------------------------------+
  11. */
  12. define(['q', 'bi/commons/ui/properties/BaseProperty', 'underscore'], function (Q, BaseProperty, _) {
  13. 'use strict'; //NOSONAR
  14. var Text = BaseProperty.extend({
  15. init: function init(options) {
  16. Text.inherited('init', this, arguments);
  17. _.extend(this, options);
  18. },
  19. render: function render() {
  20. var propertyRow = $('<div></div>');
  21. propertyRow.addClass('propertyRow');
  22. if (this.additionalClass) {
  23. propertyRow.addClass(this.additionalClass);
  24. }
  25. var property = $('<div></div>');
  26. property.addClass('propertyUIControl');
  27. if (this.text) {
  28. property.text(this.text);
  29. }
  30. propertyRow.append(property);
  31. this.$el.append(propertyRow);
  32. return Q(true);
  33. }
  34. });
  35. return Text;
  36. });