return original string when highlight is called without query; lazy format annotation date
This commit is contained in:
parent
77f0c762a3
commit
3fc8a47bf4
2 changed files with 5 additions and 4 deletions
|
@ -257,10 +257,8 @@ Ox.AnnotationFolder = function(options, self) {
|
||||||
sort: self.sort,
|
sort: self.sort,
|
||||||
submitOnBlur: false,
|
submitOnBlur: false,
|
||||||
tooltipText: self.options.showInfo ? function(item) {
|
tooltipText: self.options.showInfo ? function(item) {
|
||||||
return Ox.formatString('<b>{user}</b> {date}', {
|
return Ox.encodeHTMLEntities(item.user) + ', '
|
||||||
user: Ox.encodeHTMLEntities(item.user),
|
+ Ox.formatDate(item.modified.slice(0, 10), '%B %e, %Y');
|
||||||
date: item.date
|
|
||||||
});
|
|
||||||
} : '',
|
} : '',
|
||||||
width: self.options.width,
|
width: self.options.width,
|
||||||
maxHeight: self.options.type == 'text' ? Infinity : void 0,
|
maxHeight: self.options.type == 'text' ? Infinity : void 0,
|
||||||
|
|
|
@ -254,6 +254,9 @@
|
||||||
'<span class="c">foo <br>bar</span> baz'
|
'<span class="c">foo <br>bar</span> baz'
|
||||||
@*/
|
@*/
|
||||||
Ox.highlight = function(string, query, classname, isHTML) {
|
Ox.highlight = function(string, query, classname, isHTML) {
|
||||||
|
if (!query) {
|
||||||
|
return string;
|
||||||
|
}
|
||||||
var cursor = 0,
|
var cursor = 0,
|
||||||
entities = [],
|
entities = [],
|
||||||
matches = [],
|
matches = [],
|
||||||
|
|
Loading…
Reference in a new issue