Bug: uHidesy Has Issues with Properties with Descriptions
Umbraco 6.1.6. uHidesy 1.13. Chrome. Windows 8.1.
I have a development and a production environment, and some properties that have a description in one environment do not have a description in another environment.
It seems that uHidesy has issues with this, as it doesn't hide properties the same in each environment, and the only variable seems to be the existence of property descriptions.
This seems to be related to the fact that Umbraco injects BR tags after property names when those properties also have descriptions. When that happens, uHidesy includes an encoded form of the BR tag in the property name in the settings.json file, like this (note the "\u003cbr\u003e" at the end of the property name):
Should be simple enough. Here is what a property with a description looks like:
<div class="propertyItemheader">Header<br><small>This is the header.</small></div>
You only want "Header". So, you can select the element (".propertyItemheader"), clone it, remove the "small" element within it (using $.remove), and then call $.text (rather than $.html) on the result element. Calling $.text ensures you don't get the "br" element when you convert it to a string. Here are the existing uHidesy lines you'd want to change (I think... you'd want to make sure any time you interact with a property that you do exactly this procedure to ensure consistent results):
You should be able to adapt that for use with uHidesy. Note that you could also future-proof it a bit by removing all children. Since the $.children does not include text elements, removing all children would leave the property name text intact but would remove the "br" and "small" tags (and any other tags that may get added down the road for whatever reason).
Bug: uHidesy Has Issues with Properties with Descriptions
Umbraco 6.1.6. uHidesy 1.13. Chrome. Windows 8.1.
I have a development and a production environment, and some properties that have a description in one environment do not have a description in another environment.
It seems that uHidesy has issues with this, as it doesn't hide properties the same in each environment, and the only variable seems to be the existence of property descriptions.
This seems to be related to the fact that Umbraco injects BR tags after property names when those properties also have descriptions. When that happens, uHidesy includes an encoded form of the BR tag in the property name in the settings.json file, like this (note the "\u003cbr\u003e" at the end of the property name):
uHidesy is basically hacking the DOM with jquery. If you have a solution to this, I'm happy to add it to the package.
Should be simple enough. Here is what a property with a description looks like:
You only want "Header". So, you can select the element (".propertyItemheader"), clone it, remove the "small" element within it (using $.remove), and then call $.text (rather than $.html) on the result element. Calling $.text ensures you don't get the "br" element when you convert it to a string. Here are the existing uHidesy lines you'd want to change (I think... you'd want to make sure any time you interact with a property that you do exactly this procedure to ensure consistent results):
I just tried the following in the Chrome console to get a result of "Header" (the property name):
You should be able to adapt that for use with uHidesy. Note that you could also future-proof it a bit by removing all children. Since the $.children does not include text elements, removing all children would leave the property name text intact but would remove the "br" and "small" tags (and any other tags that may get added down the road for whatever reason).
Also, you may want to trim leading/trailing whitespace ($.trim), just to be on the safe side.
is working on a reply...