Created
January 1, 2017 23:04
-
-
Save EliJDonahue/2e95b77597f0bfc0dc1f65bd3370d5cc to your computer and use it in GitHub Desktop.
Sets the background color of a non-current item's form
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", ""); | |
| } | |
| // set form background color if the item is not current | |
| var formBody = document.getElementsByTagName("body")[0]; | |
| if (isCurr == "0") { | |
| formBody.style.backgroundColor = "#EFEFEF"; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment