You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ambari.apache.org by "Oleg Nechiporenko (JIRA)" <ji...@apache.org> on 2016/03/28 15:16:25 UTC

[jira] [Commented] (AMBARI-15599) Create computed macros `truncate`

    [ https://issues.apache.org/jira/browse/AMBARI-15599?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15214178#comment-15214178 ] 

Oleg Nechiporenko commented on AMBARI-15599:
--------------------------------------------

  25631 tests complete (25 seconds)
  154 tests pending


> Create computed macros `truncate`
> ---------------------------------
>
>                 Key: AMBARI-15599
>                 URL: https://issues.apache.org/jira/browse/AMBARI-15599
>             Project: Ambari
>          Issue Type: Task
>          Components: ambari-web
>    Affects Versions: 2.4.0
>            Reporter: Oleg Nechiporenko
>            Assignee: Oleg Nechiporenko
>             Fix For: 2.4.0
>
>         Attachments: AMBARI-15599.patch
>
>
> A computed property that returns dependent value truncated to the `reduceTo`-size if its length is greater than `maxLength` Truncated part may be replaced with `replacer` if it's provided
> {code:javascript}
> var o = Em.Object.create({
>      p1: Em.computed.truncate('p2', 8, 5, '###'),
>      p2: 'some string',
>      p3: Em.computed.truncate('p2', 8, 5)
> });
> console.log(o.get('p1')); // 'some ###'
> console.log(o.get('p3')); // 'some ...'
> o.set('p2', '123456789');
> console.log(o.get('p1')); // '12345###'
> console.log(o.get('p3')); // '12345...'
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)