Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
WEBUI: fix the wrong code logic in idnode_editor_field
  • Loading branch information
perexg committed Dec 4, 2015
1 parent 9a1b050 commit 1bf77c5
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
1 change: 1 addition & 0 deletions src/config.c
Expand Up @@ -1949,6 +1949,7 @@ const idclass_t config_class = {
.type = PT_U32,
.id = "version",
.name = N_("Configuration version"),
.desc = N_("AA"),
.off = offsetof(config_t, version),
.opts = PO_RDONLY | PO_HIDDEN | PO_EXPERT,
.group = 1
Expand Down
51 changes: 29 additions & 22 deletions src/webui/static/app/idnode.js
Expand Up @@ -634,6 +634,31 @@ tvheadend.idnode_editor_field = function(f, conf)
if (value == null)
value = f['default'];

function postfield(r, f) {
if (f.description) {
r.on('render', function(c) {
Ext.QuickTips.register({
target: c.getEl(),
text: f.description
});
Ext.QuickTips.register({
target: c.wrap,
text: f.description
});
Ext.QuickTips.register({
target: c.label,
text: f.description
});
});
r.on('beforedestroy', function(c) {
Ext.QuickTips.unregister(c.getEl());
Ext.QuickTips.unregister(c.wrap);
Ext.QuickTips.unregister(c.label);
});
}
return r;
}

/* Ordered list */
if (f['enum'] && f.lorder) {

Expand Down Expand Up @@ -708,6 +733,9 @@ tvheadend.idnode_editor_field = function(f, conf)
*/
}

if (r)
return postfield(r, f);

/* Singular */
switch (f.type) {
case 'bool':
Expand Down Expand Up @@ -820,28 +848,7 @@ tvheadend.idnode_editor_field = function(f, conf)

}

if (f.description) {
r.on('render', function(c) {
Ext.QuickTips.register({
target: c.getEl(),
text: f.description
});
Ext.QuickTips.register({
target: c.wrap,
text: f.description
});
Ext.QuickTips.register({
target: c.label,
text: f.description
});
});
r.on('beforedestroy', function(c) {
Ext.QuickTips.unregister(c.getEl());
Ext.QuickTips.unregister(c.wrap);
Ext.QuickTips.unregister(c.label);
});
}
return r;
return postfield(r, f);
};

/*
Expand Down

0 comments on commit 1bf77c5

Please sign in to comment.