mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-11 20:21:16 +00:00
sync changes in application.js
This commit is contained in:
parent
245bfe640a
commit
6b17c35804
|
@ -238,19 +238,40 @@ function initMost() {
|
|||
* actually provided to update the input field, but here we use
|
||||
* it to set the document location. */
|
||||
updater: function (item) {
|
||||
strarr = item.value.split("#");
|
||||
//console.log(this.$element.data('target'));
|
||||
target = this.$element.data('target');
|
||||
$('#'+target).attr('value', strarr[0]);
|
||||
return strarr[1];
|
||||
$('#'+target).attr('value', item.id);
|
||||
return item.value;
|
||||
},
|
||||
sorter: function(items) {
|
||||
return items;
|
||||
},
|
||||
/* Set a matcher that allows any returned value */
|
||||
matcher : function (item) {
|
||||
return true;
|
||||
},
|
||||
highlighter : function (item) {
|
||||
strarr = item.split("#");
|
||||
return '<i class="fa fa-folder-o"></i> ' + strarr[1].replace(/</g, '<');
|
||||
return '<i class="fa fa-folder-o"></i> ' + item.name.replace(/</g, '<') + (typeof(item.path) != 'undefined' ? '<br /><span class="path">' + item.path + '</span>' : '');
|
||||
},
|
||||
/* This only works with a modified version of bootstrap typeahead located
|
||||
* in boostrap-typeahead.js Search for 'render'
|
||||
* The line
|
||||
* this.render = this.options.render || this.render
|
||||
* was added to bootstrap-typeahead.js
|
||||
* The following function is a copy of the original render function but
|
||||
* access item.name instead of item
|
||||
*/
|
||||
render : function (items) {
|
||||
var that = this
|
||||
|
||||
items = $(items).map(function (i, item) {
|
||||
i = $(that.options.item).attr('data-value', item.name).attr('data-id', item.id).attr('data-type', item.type);
|
||||
i./*find('a').*/html(that.highlighter(item))
|
||||
return i[0]
|
||||
})
|
||||
|
||||
items.first().addClass('active')
|
||||
this.$menu.html(items)
|
||||
return this
|
||||
}
|
||||
}); /* }}} */
|
||||
}
|
||||
|
|
|
@ -261,8 +261,6 @@ function initMost() {
|
|||
},
|
||||
highlighter : function (item) {
|
||||
return '<i class="fa fa-folder-o"></i> ' + item.name.replace(/</g, '<') + (typeof(item.path) != 'undefined' ? '<br /><span class="path">' + item.path + '</span>' : '');
|
||||
strarr = item.split("#");
|
||||
return '<i class="fa fa-folder-o"></i> ' + strarr[1].replace(/</g, '<');
|
||||
},
|
||||
/* This only works with a modified version of bootstrap typeahead located
|
||||
* in boostrap-typeahead.js Search for 'render'
|
||||
|
|
Loading…
Reference in New Issue
Block a user