ambari-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Nechiporenko (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (AMBARI-15599) Create computed macros `truncate`
Date Tue, 29 Mar 2016 06:37:25 GMT

     [ https://issues.apache.org/jira/browse/AMBARI-15599?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Oleg Nechiporenko updated AMBARI-15599:
---------------------------------------
    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

> 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)

Mime
View raw message