Created
March 4, 2018 06:05
-
-
Save maloninc/99ce5a9ad58f8067494a999257701795 to your computer and use it in GitHub Desktop.
Open slide show record on kintone
This file contains 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
(function(){ | |
document.body.addEventListener('DOMNodeInserted', function(event){ | |
if(event.target.className == 'slideshow-cybozu'){ | |
var slideshow = event.target; | |
slideshow.addEventListener('DOMNodeInserted', function(event){ | |
if(event.target.tagName == 'IMG'){ | |
var img = event.target; | |
if(img.parentElement.className.includes('slide-image-cybozu')){ | |
img.style.cursor = 'pointer'; | |
img.onclick = function(){ | |
var params = new URLSearchParams(img.src); | |
var record_id = params.get('record'); | |
open(`/k/${kintone.app.getId()}/show#record=${record_id}`); | |
} | |
} | |
} | |
}); | |
} | |
}) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment