]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
WEBUI: fix the wrong code logic in idnode_editor_field
authorJaroslav Kysela <perex@perex.cz>
Fri, 4 Dec 2015 19:39:22 +0000 (20:39 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 4 Dec 2015 19:39:22 +0000 (20:39 +0100)
src/config.c
src/webui/static/app/idnode.js

index 4c42afa6afdf675361c83450a716f2730d92118d..ac73f4dd7aadd72c59e68e74d2567de24467655e 100644 (file)
@@ -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
index 1db2e3f352d0ddb41d5e543756bd571c14581641..d581996660edf9c4fdafacfd345bacef0f539da4 100644 (file)
@@ -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) {
 
@@ -708,6 +733,9 @@ tvheadend.idnode_editor_field = function(f, conf)
          */
     }
 
+    if (r)
+        return postfield(r, f);
+
     /* Singular */
     switch (f.type) {
         case 'bool':
@@ -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);
 };
 
 /*