Fixed JSHint complaining about making a function in a loop

print-window-tiddler
Jeremy Ruston 2012-04-03 16:59:55 +01:00
rodzic a2cd450cbe
commit b44f6b47cc
1 zmienionych plików z 8 dodań i 7 usunięć

Wyświetl plik

@ -65,18 +65,19 @@ function FileStore(dirpath,store,callback) {
if(err) {
callback(err);
} else {
for(var t=0; t<files.length; t++) {
var f = files[t];
if(["..",".",".DS_Store"].indexOf(f) === -1 && f.indexOf(".meta") !== f.length-5) {
self.loadQueue.push({
filepath: path.resolve(self.dirpath,f),
callback: function(task,tiddlers) {
var loadCallback = function(task,tiddlers) {
for(var t=0; t<tiddlers.length; t++) {
var tiddler = tiddlers[t];
self.sources[tiddler.title] = task.filepath;
self.store.addTiddler(tiddler);
}
}
};
for(var t=0; t<files.length; t++) {
var f = files[t];
if(["..",".",".DS_Store"].indexOf(f) === -1 && f.indexOf(".meta") !== f.length-5) {
self.loadQueue.push({
filepath: path.resolve(self.dirpath,f),
callback: loadCallback
});
}
}