diff --git a/editor/js/ui/utils.js b/editor/js/ui/utils.js index 525581d6e..6fcfc35e0 100644 --- a/editor/js/ui/utils.js +++ b/editor/js/ui/utils.js @@ -134,8 +134,8 @@ RED.utils = (function() { return false; } - function formatNumber(element,obj,sourceId,path,cycle) { - var format = (formattedPaths[sourceId] && formattedPaths[sourceId][path]) || "dec"; + function formatNumber(element,obj,sourceId,path,cycle,initialFormat) { + var format = (formattedPaths[sourceId] && formattedPaths[sourceId][path]) || initialFormat || "dec"; if (cycle) { if (format === 'dec') { if ((obj.toString().length===13) && (obj<=2147483647000)) { @@ -152,6 +152,9 @@ RED.utils = (function() { } formattedPaths[sourceId] = formattedPaths[sourceId]||{}; formattedPaths[sourceId][path] = format; + } else if (initialFormat !== undefined){ + formattedPaths[sourceId] = formattedPaths[sourceId]||{}; + formattedPaths[sourceId][path] = format; } if (format === 'dec') { element.text(""+obj); @@ -262,7 +265,7 @@ RED.utils = (function() { formatNumber($(this), obj, sourceId, path, true); }); } - formatNumber(e,obj,sourceId,path,false); + formatNumber(e,obj,sourceId,path,false,typeHint==='hex'?'hex':undefined); } else if (isArray) { element.addClass('collapsed'); @@ -343,7 +346,7 @@ RED.utils = (function() { if (fullLength <= 10) { for (i=0;i