1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-16 10:29:54 +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.
*/
$tw.utils.pushOnce = function(array,value) {
if(0 > array.indexOf(value)){
if(array.indexOf(value) == -1) {
array.push(value);
}
}

View File

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