Explorar o código

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

Enrico Berti %!s(int64=8) %!d(string=hai) anos
pai
achega
74458294d3
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  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,