From c5fe7db5023c9ec72d06915525815ef2caeff68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Urban?= Date: Thu, 29 Aug 2013 09:05:42 +0200 Subject: [PATCH] Changed 'cloneObject' method in M.ListView class. With this solution you can use JavaScript object as values in valuePattern. toString method will be invoked on this object and returned value will replace <%= %> tag. Originally when object was present in values, valuePattern was ignored. --- modules/ui/list.js | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/modules/ui/list.js b/modules/ui/list.js index 85fae4424..347fa4dae 100644 --- a/modules/ui/list.js +++ b/modules/ui/list.js @@ -477,13 +477,8 @@ M.ListView = M.View.extend( case 'M.ImageView': case 'M.TextFieldView': while(regexResult !== null) { - if(typeof(record[regexResult[1]]) === 'object') { - pattern = record[regexResult[1]]; - regexResult = null; - } else { - pattern = pattern.replace(regexResult[0], record[regexResult[1]]); - regexResult = /<%=\s+([.|_|-|$|§|@|a-zA-Z0-9\s]+)\s+%>/.exec(pattern); - } + pattern = pattern.replace(regexResult[0], record[regexResult[1]]); + regexResult = /<%=\s+([.|_|-|$|§|@|a-zA-Z0-9\s]+)\s+%>/.exec(pattern); } obj[childViewsArray[i]].value = pattern; break;