1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-25 23:03:15 +00:00

adopted style recommendations

This commit is contained in:
Tobias Beer 2015-01-29 00:45:58 +01:00
parent d0a24bd9f0
commit 91b5547cdf
2 changed files with 3 additions and 3 deletions

View File

@ -88,7 +88,7 @@ $tw.utils.each = function(object,callback) {
Pushes a value to an array only when not yet contained. Pushes a value to an array only when not yet contained.
*/ */
$tw.utils.pushOnce = function(array,value) { $tw.utils.pushOnce = function(array,value) {
if(0 > array.indexOf(value)){ if(array.indexOf(value) == -1) {
array.push(value); array.push(value);
} }
} }

View File

@ -20,10 +20,10 @@ exports.each = function(source,operator,options) {
var results =[] , var results =[] ,
value,values = {}, value,values = {},
field = operator.operand || "title"; field = operator.operand || "title";
if("list" !== operator.suffix) { if(operator.suffix !== "list") {
source(function(tiddler,title) { source(function(tiddler,title) {
if(tiddler) { if(tiddler) {
value = "title" === field ? title : tiddler.getFieldString(field); value = (field === "title") ? title : tiddler.getFieldString(field);
if(!$tw.utils.hop(values,value)) { if(!$tw.utils.hop(values,value)) {
values[value] = true; values[value] = true;
results.push(title); results.push(title);