Browse Source

added functionality

added onchange to input fields; added toggle method to instance…
pull/25/head
peterd 7 years ago
parent
commit
5aa5a484af
  1. 6
      index.html
  2. 8
      jqColorPicker.js
  3. 2
      jqColorPicker.js.map
  4. 2
      jqColorPicker.min.js

6
index.html

@ -66,9 +66,9 @@ window.myColorPicker = $('input.color').colorPicker({
<p>Will follow... See <a href="https://github.com/PitPik/tinyColorPicker">tinyColorPicke on GitHub</a> for now.</p>
<!-- <script type="text/javascript" src="jquery-1.11.2.js"></script> -->
<script src="http://code.jquery.com/jquery-1.11.2.min.js"></script>
<!-- <script type="text/javascript" src="colors.js"></script> -->
<!-- <script type="text/javascript" src="jqColorPicker.js"></script> -->
<script type="text/javascript" src="jqColorPicker.min.js"></script>
<script type="text/javascript" src="colors.js"></script>
<script type="text/javascript" src="jqColorPicker.js"></script>
<!-- <script type="text/javascript" src="jqColorPicker.min.js"></script> -->
<script type="text/javascript">
(function(window, undefined){
'use strict';

8
jqColorPicker.js

@ -43,6 +43,7 @@
};
ColorPicker.prototype.render = render;
ColorPicker.prototype.toggle = toggle;
function extractValue(elm) {
return elm.value || $(elm).css('background-color') || '#fff';
@ -251,7 +252,12 @@
!$(e.target).closest(_$UI).length) {
toggle();
}
}).on('focus', this.selector, toggle);
}).
on('focus', this.selector, toggle).
on('change', this.selector, function() {
_color.setColor(this.value);
$that.colorPicker.render();
});
}
this.colorPicker = _colorPicker;

2
jqColorPicker.js.map
File diff suppressed because it is too large
View File

2
jqColorPicker.min.js
File diff suppressed because it is too large
View File

Loading…
Cancel
Save