webui: some attempt to make enum lists more usable.

This commit is contained in:
Adam Sutton 2013-09-10 16:27:22 +01:00
parent 10854c1cf4
commit 73b35edae7
2 changed files with 11 additions and 5 deletions

View file

@ -127,14 +127,19 @@ static const char *
service_class_get_title ( idnode_t *self )
{
static char *ret = NULL;
const char *str = NULL;
service_t *s = (service_t*)self;
pthread_mutex_lock(&s->s_stream_mutex);
if (ret) {
free(ret);
ret = NULL;
}
pthread_mutex_lock(&s->s_stream_mutex);
if (s->s_nicename)
ret = strdup(s->s_nicename);
if (s->s_channel_name)
str = s->s_channel_name(s);
if (!str)
str = s->s_nicename;
if (str)
ret = strdup(str);
pthread_mutex_unlock(&s->s_stream_mutex);
return ret;
}

View file

@ -128,10 +128,11 @@ tvheadend.idnode_editor_field = function(f, create)
valueField : 'key',
displayField : 'val',
store : tvheadend.idnode_enum_store(f),
typeAhead : true,
forceSelection : true,
/*typeAhead : true,*/
/*forceSelection : true,*/
triggerAction : 'all',
emptyText :'Select ' + f.caption +' ...',
clearFilterOnReset: false,
listeners : {
keyup: function() {
this.store.filter('val', this.getRawValue(), true, false);