SFJS 0.3.4
This commit is contained in:
@@ -1,28 +1,9 @@
|
||||
class NoteHistoryEntry extends SFItemHistoryEntry {
|
||||
|
||||
setPreviousEntry(previousEntry) {
|
||||
super.setPreviousEntry(previousEntry);
|
||||
if(previousEntry) {
|
||||
this.textCharDiffLength = this.item.content.text.length - previousEntry.item.content.text.length;
|
||||
} else {
|
||||
this.textCharDiffLength = this.item.content.text.length;
|
||||
}
|
||||
}
|
||||
|
||||
previewTitle() {
|
||||
return this.item.updated_at.toLocaleString();
|
||||
}
|
||||
|
||||
operationVector() {
|
||||
if(!this.hasPreviousEntry || this.textCharDiffLength == 0) {
|
||||
return 0;
|
||||
} else if(this.textCharDiffLength < 0) {
|
||||
return -1;
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
previewSubTitle() {
|
||||
if(!this.hasPreviousEntry) {
|
||||
return `${this.textCharDiffLength} characters loaded`
|
||||
|
||||
Reference in New Issue
Block a user