Created
January 1, 2017 23:36
-
-
Save EliJDonahue/4b9b4d9ac026f6b791ee9d59ce1ed679 to your computer and use it in GitHub Desktop.
Displays a watermark image when the context item is not the current generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var itm = document.thisItem; | |
| var inn = itm.getInnovator(); | |
| // if is_current property exists in the cache, use it | |
| var isCurr = itm.getProperty("is_current",""); | |
| // else, retrieve is_current from the database | |
| if(isCurr === ""){ | |
| itm = inn.getItemById(itm.getID()); | |
| isCurr = itm.getProperty("is_current", ""); | |
| } | |
| // show overlay image field | |
| var overlay = document.getElementById("img-overlay"); | |
| if (isCurr == "0") { | |
| overlay.style.visibility = "visible"; | |
| overlay.style.display = ""; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment