mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2024-06-25 06:43:15 +00:00
Coding style clean up for #1330
This commit is contained in:
parent
b6aa5bf78a
commit
ec829180f4
|
@ -71,7 +71,7 @@ ListWidget.prototype.execute = function() {
|
||||||
members = this.getEmptyMessage();
|
members = this.getEmptyMessage();
|
||||||
} else {
|
} else {
|
||||||
$tw.utils.each(this.list,function(title,index) {
|
$tw.utils.each(this.list,function(title,index) {
|
||||||
members.push(self.makeItemTemplate(title, index, count, self.iterator));
|
members.push(self.makeItemTemplate(title,index,count,self.iterator));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
// Construct the child widgets
|
// Construct the child widgets
|
||||||
|
@ -98,7 +98,7 @@ ListWidget.prototype.getEmptyMessage = function() {
|
||||||
/*
|
/*
|
||||||
Compose the template for a list item
|
Compose the template for a list item
|
||||||
*/
|
*/
|
||||||
ListWidget.prototype.makeItemTemplate = function(title, index, count, iterator) {
|
ListWidget.prototype.makeItemTemplate = function(title,index,count,iterator) {
|
||||||
// Check if the tiddler is a draft
|
// Check if the tiddler is a draft
|
||||||
var tiddler = this.wiki.getTiddler(title),
|
var tiddler = this.wiki.getTiddler(title),
|
||||||
isDraft = tiddler && tiddler.hasField("draft.of"),
|
isDraft = tiddler && tiddler.hasField("draft.of"),
|
||||||
|
@ -305,9 +305,8 @@ ListItemWidget.prototype.execute = function() {
|
||||||
// Set the current list item title
|
// Set the current list item title
|
||||||
this.setVariable(item.variableName,item.itemTitle);
|
this.setVariable(item.variableName,item.itemTitle);
|
||||||
this.setVariable(item.iterator,(item.index + 1).toString());
|
this.setVariable(item.iterator,(item.index + 1).toString());
|
||||||
this.setVariable(item.iterator + "-even",item.index % 2 == 1 ? 'true' : 'false');
|
this.setVariable(item.iterator + "-even",item.index % 2 == 1 ? "true" : "false");
|
||||||
this.setVariable(item.iterator + "-last",item.index + 1 == item.count ? 'true' : 'false');
|
this.setVariable(item.iterator + "-last",item.index + 1 == item.count ? "true" : "false");
|
||||||
|
|
||||||
// Construct the child widgets
|
// Construct the child widgets
|
||||||
this.makeChildWidgets();
|
this.makeChildWidgets();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user