Skip to content

Instantly share code, notes, and snippets.

@maloninc
Created March 4, 2018 06:05
Show Gist options
  • Save maloninc/99ce5a9ad58f8067494a999257701795 to your computer and use it in GitHub Desktop.
Save maloninc/99ce5a9ad58f8067494a999257701795 to your computer and use it in GitHub Desktop.
Open slide show record on kintone
(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