comparison ape.js @ 968:be4abf039d42

Fixed small slider bug causing non-full screen testing to have sliders appear further to the left after dropping
author Nicholas Jillings <nicholas.jillings@eecs.qmul.ac.uk>
date Wed, 27 May 2015 19:00:20 +0100
parents 16852cf211eb
children 917676cbdcc8
comparison
equal deleted inserted replaced
967:16852cf211eb 968:be4abf039d42
493 // Function call when a div has been dropped 493 // Function call when a div has been dropped
494 var slider = document.getElementById('slider'); 494 var slider = document.getElementById('slider');
495 var marginSize = Number(slider.attributes['marginsize'].value); 495 var marginSize = Number(slider.attributes['marginsize'].value);
496 var w = slider.style.width; 496 var w = slider.style.width;
497 w = Number(w.substr(0,w.length-2)); 497 w = Number(w.substr(0,w.length-2));
498 var x = ev.x - ev.view.screenX; 498 var x = ev.x;
499 if (x >= marginSize && x < w+marginSize) { 499 if (x >= marginSize && x < w+marginSize) {
500 this.style.left = (x)+'px'; 500 this.style.left = (x)+'px';
501 } else { 501 } else {
502 if (x<marginSize) { 502 if (x<marginSize) {
503 this.style.left = marginSize+'px'; 503 this.style.left = marginSize+'px';