mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-25 23:03:15 +00:00
removed pushOnce
This commit is contained in:
parent
91b5547cdf
commit
95eb8810b6
|
@ -84,15 +84,6 @@ $tw.utils.each = function(object,callback) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
Pushes a value to an array only when not yet contained.
|
|
||||||
*/
|
|
||||||
$tw.utils.pushOnce = function(array,value) {
|
|
||||||
if(array.indexOf(value) == -1) {
|
|
||||||
array.push(value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Helper for making DOM elements
|
Helper for making DOM elements
|
||||||
tag: tag name
|
tag: tag name
|
||||||
|
|
|
@ -29,14 +29,17 @@ exports.each = function(source,operator,options) {
|
||||||
results.push(title);
|
results.push(title);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
source(function(tiddler,title) {
|
source(function(tiddler,title) {
|
||||||
if(tiddler) {
|
if(tiddler) {
|
||||||
$tw.utils.each(
|
$tw.utils.each(
|
||||||
options.wiki.getTiddlerList(title,field),
|
options.wiki.getTiddlerList(title,field),
|
||||||
function(value) {
|
function(value) {
|
||||||
$tw.utils.pushOnce(results,value);
|
if(!$tw.utils.hop(values,value)) {
|
||||||
|
values[value] = true;
|
||||||
|
results.push(value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user