Skip to content

Instantly share code, notes, and snippets.

@EliJDonahue
Created January 1, 2017 23:36
Show Gist options
  • Select an option

  • Save EliJDonahue/4b9b4d9ac026f6b791ee9d59ce1ed679 to your computer and use it in GitHub Desktop.

Select an option

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
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