Page Index Toggle Pages: 1
Topic Tools
Color picker not working in Firefox and Safari (Read 1,484 times)
Jet Li
Legacy Dev Team
Development Team
****
Offline



Posts: 6,588
Location: Hong Kong
Re: Color picker not working in Firefox and Safari
Reply #1 - Feb 20th, 2010 at 7:06pm
Post Tools
Confirmed.

New
yabbfiles/palette.js
in CVS.
  

PM me for YaBB Installation Service
Back to top
WWWGTalkFacebook  
IP Logged
 
Carsten
Ex Member


Color picker not working in Firefox and Safari
Feb 20th, 2010 at 6:58pm
Post Tools
The 3 'color sliders' in the palette color picker are not working in 2.4 in Firefox and Safari.

The fix:

In palette.js replace
Code
Select All
var skydNu = false;
var x, knapObj, retning;

function flytKnap(e) {
	if (skydNu) {
		glX = parseInt(knapObj.style.left+0);
		if(ns6) knapObj.style.left = temp2 + e.clientX - x; else knapObj.style.left = temp2 + event.clientX - x;
		nyX = parseInt(knapObj.style.left+0);
		if (nyX > glX) retning = "vn"; else retning = "hj";
		if (nyX < 4 && retning == "hj") { knapObj.style.left = 4; retning = "vn"; }
		if (nyX > 259 && retning == "vn") { knapObj.style.left = 259; retning = "hj"; }
		delEnh = parseInt(knapObj.style.left+0)-4;
		setColor(delEnh);
		document.onmouseup = saveColor;
		return false;
	}
}

function skydeKnap(e){
	if (ns6) flytobj = e.target; else flytobj = event.srcElement;
	if (ns6) topelement = "HTML"; else topelement = "BODY";
	while (flytobj.tagName != topelement && flytobj.className != "skyd"){
		if(ns6) flytobj = flytobj.parentNode; else flytobj = flytobj.parentElement;
	}
	if (flytobj.className == "skyd"){
		skydNu = true;
		knapObj = flytobj;
		temp2 = parseInt(knapObj.style.left+0);
		if(ns6) x = e.clientX; else x = event.clientX;
		document.onmousemove = flytKnap;
		return false;
	}
} 


with
Code
Select All
var skydNu = false;
var x, knapObj, knappos, retning;

function flytKnap(e) {
	if (skydNu) {
		glX = parseInt(knappos);
		if(ns6) knappos = temp2 + e.clientX - x; else knappos = temp2 + event.clientX - x;
		nyX = parseInt(knappos);
		if (nyX > glX) retning = "vn"; else retning = "hj";
		if (nyX < 4 && retning == "hj") { knappos = 4; retning = "vn"; }
		if (nyX > 259 && retning == "vn") { knappos = 259; retning = "hj"; }
		knapObj.style.left = knappos + 'px';
		delEnh = parseInt(knappos)-4;
		setColor(delEnh);
		document.onmouseup = saveColor;
		return false;
	}
}

function skydeKnap(e){
	if (ns6) flytobj = e.target; else flytobj = event.srcElement;
	if (ns6) topelement = "HTML"; else topelement = "BODY";
	while (flytobj.tagName != topelement && flytobj.className != "skyd"){
		if(ns6) flytobj = flytobj.parentNode; else flytobj = flytobj.parentElement;
	}
	if (flytobj.className == "skyd"){
		skydNu = true;
		knapObj = flytobj;
		knappos = knapObj.style.left;
		temp2 = parseInt(knappos);
		if(ns6) x = e.clientX; else x = event.clientX;
		document.onmousemove = flytKnap;
		return false;
	}
} 

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Topic Tools
 
  « Board Index ‹ Board  ^Top