try fixing drag to move again
This commit is contained in:
parent
702dcf7997
commit
7527e4c978
@ -272,19 +272,22 @@ function init(prefix) {
|
|||||||
var originalY = 10;
|
var originalY = 10;
|
||||||
rpl.moveTo(originalX, originalY);
|
rpl.moveTo(originalX, originalY);
|
||||||
|
|
||||||
e.addEventListener("mousedown", function(ev) {
|
e.addEventListener("dragstart", function(ev) {
|
||||||
mouseDownX = ev.clientX;
|
mouseDownX = ev.clientX;
|
||||||
mouseDownY = ev.clientY;
|
mouseDownY = ev.clientY;
|
||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
});
|
ev.preventDefault();
|
||||||
|
|
||||||
|
}, false);
|
||||||
|
|
||||||
e.addEventListener("mouseup", function(ev) {
|
e.addEventListener("dragend", function(ev) {
|
||||||
ev.stopPropagation();
|
|
||||||
var x = originalX + ev.clientX - mouseDownX
|
var x = originalX + ev.clientX - mouseDownX
|
||||||
var y = originalY + ev.clientY - mouseDownY
|
var y = originalY + ev.clientY - mouseDownY
|
||||||
rpl.moveTo(x, y);
|
rpl.moveTo(x, y);
|
||||||
originalX = x;
|
originalX = x;
|
||||||
originalY = y;
|
originalY = y;
|
||||||
});
|
ev.stopPropagation();
|
||||||
|
ev.preventDefault();
|
||||||
|
}, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,9 +38,9 @@ parent.appendChild(wrapper);parent.backlink=false;},function(msg){var wrapper=do
|
|||||||
parent.backlink=true;}};parent.backlink=true;}
|
parent.backlink=true;}};parent.backlink=true;}
|
||||||
function inject_hover_for_element(elem){var elems=elem.getElementsByClassName("backlink");var ls=[];var l=elems.length;for(var idx=0;idx<l;idx++){var e=elems[idx];ls.push(e);}
|
function inject_hover_for_element(elem){var elems=elem.getElementsByClassName("backlink");var ls=[];var l=elems.length;for(var idx=0;idx<l;idx++){var e=elems[idx];ls.push(e);}
|
||||||
for(var elem in ls){inject_hover(prefix,ls[elem]);}}
|
for(var elem in ls){inject_hover(prefix,ls[elem]);}}
|
||||||
function init(prefix){inject_hover_for_element(document);var rpl=getReplyTo();rpl.setPrefix(prefix);var e=rpl.elem;var mouseDownX,mouseDownY;var originalX=window.width-300;var originalY=10;rpl.moveTo(originalX,originalY);e.addEventListener("mousedown",function(ev){mouseDownX=ev.clientX;mouseDownY=ev.clientY;ev.stopPropagation();});e.addEventListener("mouseup",function(ev){ev.stopPropagation();var x=originalX+ev.clientX-mouseDownX
|
function init(prefix){inject_hover_for_element(document);var rpl=getReplyTo();rpl.setPrefix(prefix);var e=rpl.elem;var mouseDownX,mouseDownY;var originalX=window.width-300;var originalY=10;rpl.moveTo(originalX,originalY);e.addEventListener("dragstart",function(ev){mouseDownX=ev.clientX;mouseDownY=ev.clientY;ev.stopPropagation();ev.preventDefault();},false);e.addEventListener("dragend",function(ev){var x=originalX+ev.clientX-mouseDownX
|
||||||
var y=originalY+ev.clientY-mouseDownY
|
var y=originalY+ev.clientY-mouseDownY
|
||||||
rpl.moveTo(x,y);originalX=x;originalY=y;});}
|
rpl.moveTo(x,y);originalX=x;originalY=y;ev.stopPropagation();ev.preventDefault();},false);}
|
||||||
/* ./contrib/js/banner.js */
|
/* ./contrib/js/banner.js */
|
||||||
var banner_count=3;function nntpchan_inject_banners(elem,prefix){var n=Math.floor(Math.random()*banner_count);var banner=prefix+"static/banner_"+n+".jpg";var e=document.createElement("img");e.src=banner;e.id="nntpchan_banner";elem.appendChild(e);}
|
var banner_count=3;function nntpchan_inject_banners(elem,prefix){var n=Math.floor(Math.random()*banner_count);var banner=prefix+"static/banner_"+n+".jpg";var e=document.createElement("img");e.src=banner;e.id="nntpchan_banner";elem.appendChild(e);}
|
||||||
/* ./contrib/js/expand-image.js */
|
/* ./contrib/js/expand-image.js */
|
||||||
|
Reference in New Issue
Block a user