From 53c1e754fe9d97603262e5646faddad57aea2063 Mon Sep 17 00:00:00 2001 From: nglk Date: Fri, 8 Jan 2021 15:23:07 +0100 Subject: [PATCH] tried to fix close video when click x but didnt work --- static/js/d3_map.js | 79 +++------------------------------------------ 1 file changed, 4 insertions(+), 75 deletions(-) diff --git a/static/js/d3_map.js b/static/js/d3_map.js index 7dcce0b..914398d 100644 --- a/static/js/d3_map.js +++ b/static/js/d3_map.js @@ -66,21 +66,14 @@ d3.json("/static/js/group1.json", function(error, json) { }) .on("click", function(i) { // popup video - jQuery('.ui-widget-overlay').bind('click',function(){ - jQuery('#showvideo').dialog('close'); - }); + // this is for next the this.parent... ;var video=document.getElementById('#video" + i.id + "');video.pause(); + $('#showvideo').hide(); if (i.url) { divVideo.transition().duration(100); - divVideo.html("
  × 
"); - } + divVideo.html("
  × 
"); + }; divBio.transition().duration(100); divBio.html("
  × 
" + i.bio + "
"); - // draggable - - - // div.on(".drag", null); - // span.html("×"); - // rest pop up popup(i.id, i.time); }) .on("dblclick", connectedNodes) @@ -155,70 +148,6 @@ d3.json("/static/js/group1.json", function(error, json) { - // no overlapping - - //var padding = 10, // separation between circles - // radius=8; - //function collide(alpha) { - // var quadtree = d3.geom.quadtree(<.nodes); - // return function(d) { - // var rb = 2*radius + padding, - // nx1 = d.x - rb, - // nx2 = d.x + rb, - // ny1 = d.y - rb, - // ny2 = d.y + rb; - // quadtree.visit(function(quad, x1, y1, x2, y2) { - // if (quad.point && (quad.point !== d)) { - // var x = d.x - quad.point.x, - // y = d.y - quad.point.y, - // l = Math.sqrt(x * x + y * y); - // if (l < rb) { - // l = (l - rb) / l * alpha; - // d.x -= x *= l; - // d.y -= y *= l; - // quad.point.x += x; - // quad.point.y += y; - // } - // } - // return x1 > nx2 || x2 < nx1 || y1 > ny2 || y2 < ny1; - // }); - // }; - //} - - // scripts for mouse events - // var stopVideo = function (name) { - // function stopVideo(name) { - // var iframe = document.querySelector( 'iframe'); - // var video = document.getElementById( "#video"+name ); - // if ( iframe !== null ) { - // var iframeSrc = iframe.src; - // iframe.src = iframeSrc; - // } - // if ( video !== null ) { - // video.pause(); - // } - // }; - - // $(function (){ - // $('.topleft').click(function(){ - // $('iframe').attr('src', $('iframe').attr('src')); - // }); - // }); - - - // function pauseAllVideos(name) - // { - // $("#video"+name).each(function(){ - // this.contentWindow.postMessage('{"event":"command","func":"stopVideo","args":""}', '*') - // }); - // } - - function pauseAllVideos(name) { - $("video" + name).each(function() { - $(this).stopVideo(); - }); - }; - // $(function (){ // $('.topleft').click(function(){ // $('iframe').attr('src', $('iframe').attr('src'));