From af2c6cb7cc308d7f37b54013c9606316f921939f Mon Sep 17 00:00:00 2001 From: peterd Date: Sat, 13 Sep 2014 20:48:07 +0200 Subject: [PATCH] readonly support --- colorPicker.jquery.json | 2 +- jQuery_implementation/index.html | 2 +- jQuery_implementation/jqColor.js | 3 +++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/colorPicker.jquery.json b/colorPicker.jquery.json index f60878d..25ae28d 100644 --- a/colorPicker.jquery.json +++ b/colorPicker.jquery.json @@ -7,7 +7,7 @@ "color", "colour" ], - "version": "1.0", + "version": "1.0.0.1", "author": { "name": "Peter Dematté", "email": "colorPicker@dematte.at", diff --git a/jQuery_implementation/index.html b/jQuery_implementation/index.html index 13c68a1..528a07f 100644 --- a/jQuery_implementation/index.html +++ b/jQuery_implementation/index.html @@ -30,7 +30,7 @@ Calling the colorPicker on all inputs with the calssName 'color':
$('input.
 
 
 
diff --git a/jQuery_implementation/jqColor.js b/jQuery_implementation/jqColor.js
index ab1b976..deb0a04 100644
--- a/jQuery_implementation/jqColor.js
+++ b/jQuery_implementation/jqColor.js
@@ -170,6 +170,9 @@
 					var value = elm.value.split('(');
 					$(elm).data('colorMode', value[1] ? value[0].substr(0, 3) : 'HEX');
 					doEventListeners(elm, (config && config.multipleInstances), false);
+					if (config && config.readOnly) {
+						elm.readOnly = true;
+					}
 				}
 			});