Commit 5a072942 authored by Yuliya Bozhko's avatar Yuliya Bozhko Committed by Gerrit Code Review
Browse files

Merge "Update jscolor to version 1.4.3 (Bug #1384489)"

parents a8c46db7 c135b430
......@@ -4,7 +4,7 @@ JSColor
Name : JavaScript Color Picker (Chooser)
Website: http://jscolor.com/
Author : (c)2008-2013 Jan Odvarko
Version: 1.4.1
Version: 1.4.3
Licence: jscolor is LGPL licensed (see: http://www.gnu.org/copyleft/lesser.html)
This color picker is used by Pieforms' color element.
......
/**
* jscolor, JavaScript Color Picker
*
* @version 1.4.1
* @version 1.4.3
* @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
* @author Jan Odvarko, http://odvarko.cz
* @created 2008-06-15
* @updated 2013-04-08
* @updated 2014-07-16
* @link http://jscolor.com
*/
......@@ -67,15 +67,15 @@ var jscolor = {
bind : function() {
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')\\s*(\\{[^}]*\\})?', 'i');
var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
var e = document.getElementsByTagName('input');
for(var i=0; i<e.length; i+=1) {
var m;
if(!e[i].color && e[i].className && (m = e[i].className.match(matchClass))) {
var prop = {};
if(m[3]) {
if(m[4]) {
try {
prop = (new Function ('return (' + m[3] + ')'))();
prop = (new Function ('return (' + m[4] + ')'))();
} catch(eInvalidProp) {}
}
e[i].color = new jscolor.color(e[i], prop);
......@@ -628,7 +628,7 @@ var jscolor = {
}
};
if('ontouchstart' in window) { // if touch device
p.box.addEventListener('touchmove', function(e) {
var handle_touchmove = function(e) {
var event={
'offsetX': e.touches[0].pageX-touchOffset.X,
'offsetY': e.touches[0].pageY-touchOffset.Y
......@@ -640,7 +640,9 @@ var jscolor = {
}
e.stopPropagation(); // prevent move "view" on broswer
e.preventDefault(); // prevent Default - Android Fix (else android generated only 1-2 touchmove events)
}, false);
};
p.box.removeEventListener('touchmove', handle_touchmove, false)
p.box.addEventListener('touchmove', handle_touchmove, false)
}
p.padM.onmouseup =
p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment