浏览代码

HUE-7074 [frontend] Extend hueDebug to accept the id of the element as well

Enrico Berti 8 年之前
父节点
当前提交
74458294d3
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      desktop/core/src/desktop/templates/hue.mako

+ 3 - 0
desktop/core/src/desktop/templates/hue.mako

@@ -1496,6 +1496,9 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
 
     window.hueDebug = {
       viewModel: function (element) {
+        if (typeof element !== 'undefined' && typeof element === 'string') {
+          element = $(element)[0];
+        }
         return element ? ko.dataFor(element) : window.hueDebug.onePageViewModel;
       },
       onePageViewModel: onePageViewModel,