Return-Path: X-Original-To: apmail-ambari-issues-archive@minotaur.apache.org Delivered-To: apmail-ambari-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 068D2195FF for ; Tue, 29 Mar 2016 06:37:26 +0000 (UTC) Received: (qmail 20143 invoked by uid 500); 29 Mar 2016 06:37:26 -0000 Delivered-To: apmail-ambari-issues-archive@ambari.apache.org Received: (qmail 20113 invoked by uid 500); 29 Mar 2016 06:37:26 -0000 Mailing-List: contact issues-help@ambari.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@ambari.apache.org Delivered-To: mailing list issues@ambari.apache.org Received: (qmail 20104 invoked by uid 99); 29 Mar 2016 06:37:25 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Mar 2016 06:37:25 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 89ECE2C14F6 for ; Tue, 29 Mar 2016 06:37:25 +0000 (UTC) Date: Tue, 29 Mar 2016 06:37:25 +0000 (UTC) From: "Oleg Nechiporenko (JIRA)" To: issues@ambari.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (AMBARI-15599) Create computed macros `truncate` MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ 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)