buidCallback -> buildCallback
pull/25/head
peterd 9 years ago
parent e693f745d5
commit 238ce7ed87

@ -35,7 +35,7 @@ $('.color').colorPicker({
opacity: true, // enable / disable alpha slider opacity: true, // enable / disable alpha slider
renderCallback: function($elm, toggled) {}, // this === instance; $elm: the input field;toggle === true -> just appeared; false -> opposite; else -> is rendering on pointer move renderCallback: function($elm, toggled) {}, // this === instance; $elm: the input field;toggle === true -> just appeared; false -> opposite; else -> is rendering on pointer move
// toggled true/false can for example be used to check if the $elm has a certain className and then hide alpha,... // toggled true/false can for example be used to check if the $elm has a certain className and then hide alpha,...
buidCallback: function($elm) {}, // this === instance; $elm: the UI buildCallback: function($elm) {}, // this === instance; $elm: the UI
css: '', // replaces existing css css: '', // replaces existing css
cssAddon: '', // adds css to existing cssAddon: '', // adds css to existing
margin: '', // positioning margin (can also be set in cssAddon) margin: '', // positioning margin (can also be set in cssAddon)

@ -63,7 +63,7 @@ As Tiny jQuery colorPicker uses <a href="https://github.com/PitPik/colorPicker/b
<p>The following snipped shows how easy it is to make plugins: use for mobile</p> <p>The following snipped shows how easy it is to make plugins: use for mobile</p>
<pre style="display: block; overflow: auto;"> <pre style="display: block; overflow: auto;">
window.myColorPicker = $('input.color').colorPicker({ window.myColorPicker = $('input.color').colorPicker({
buidCallback: function($elm) { buildCallback: function($elm) {
$elm.prepend('&lt;div class="cp-disp">&lt;/div>'); $elm.prepend('&lt;div class="cp-disp">&lt;/div>');
}, },
cssAddon: cssAddon:
@ -95,9 +95,9 @@ window.myColorPicker = $('input.color').colorPicker({
<!-- <script type="text/javascript" src="jquery-1.11.2.js"></script> --> <!-- <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 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="colors.js"></script>
<!-- <script type="text/javascript" src="jqColorPicker.js"></script> --> <script type="text/javascript" src="jqColorPicker.js"></script>
<script type="text/javascript" src="jqColorPicker.min.js"></script> <!-- <script type="text/javascript" src="jqColorPicker.min.js"></script> -->
<script type="text/javascript"> <script type="text/javascript">
(function(window, undefined){ (function(window, undefined){
'use strict'; 'use strict';
@ -128,7 +128,7 @@ window.myColorPicker = $('input.color').colorPicker({
animationSpeed: 0, animationSpeed: 0,
// demo on how to make plugins... mobile support plugin // demo on how to make plugins... mobile support plugin
buidCallback: function($elm) { buildCallback: function($elm) {
$elm.prepend('<div class="cp-disp"></div>'); $elm.prepend('<div class="cp-disp"></div>');
$('.color').on('click', function(e) { $('.color').on('click', function(e) {
e.preventDefault && e.preventDefault(); e.preventDefault && e.preventDefault();
@ -161,7 +161,7 @@ window.myColorPicker = $('input.color').colorPicker({
margin: '4px -2px 0', margin: '4px -2px 0',
doRender: 'div div', doRender: 'div div',
buidCallback: function($elm) { buildCallback: function($elm) {
var colorInstance = this.color, var colorInstance = this.color,
colorPicker = this; colorPicker = this;
@ -223,7 +223,7 @@ window.myColorPicker = $('input.color').colorPicker({
doRender: 'div div', doRender: 'div div',
opacity: false, opacity: false,
buidCallback: function($elm) { buildCallback: function($elm) {
var colorInstance = this.color, var colorInstance = this.color,
colorPicker = this, colorPicker = this,
random = function(n) { random = function(n) {
@ -295,7 +295,7 @@ window.myColorPicker = $('input.color').colorPicker({
margin: '4px -2px 0', margin: '4px -2px 0',
doRender: 'div div', doRender: 'div div',
// this demo adds divs with gradiends,... you could simply load an image as well // this demo adds divs with gradiends,... you could simply load an image as well
buidCallback: function($elm) { buildCallback: function($elm) {
var that = this; var that = this;
$elm.find('.cp-z-slider').prepend( $elm.find('.cp-z-slider').prepend(
@ -507,7 +507,7 @@ window.myColorPicker = $('input.color').colorPicker({
'9ACD32': 'yellowgreen' '9ACD32': 'yellowgreen'
}, },
buidCallback: function($elm) { buildCallback: function($elm) {
var that = this; var that = this;
$elm.append('<div class="cp-patch"><div></div></div><div class="cp-disp"></div>'); $elm.append('<div class="cp-patch"><div></div></div><div class="cp-disp"></div>');

@ -118,7 +118,7 @@
_$z_cursor = $('.cp-z-cursor', this); _$z_cursor = $('.cp-z-cursor', this);
_$alpha = $('.cp-alpha', this).toggle(!!_options.opacity); _$alpha = $('.cp-alpha', this).toggle(!!_options.opacity);
_$alpha_cursor = $('.cp-alpha-cursor', this); _$alpha_cursor = $('.cp-alpha-cursor', this);
_options.buidCallback.call(_colorPicker, $(this)); _options.buildCallback.call(_colorPicker, $(this));
$(this).prepend('<div>').children().eq(0).css('width', $(this).prepend('<div>').children().eq(0).css('width',
$(this).children().eq(0).width() // stabilizer $(this).children().eq(0).width() // stabilizer
); );
@ -261,7 +261,7 @@
customBG: '#FFF', customBG: '#FFF',
opacity: true, opacity: true,
renderCallback: noop, renderCallback: noop,
buidCallback: noop, buildCallback: noop,
body: document.body, body: document.body,
scrollResize: true, scrollResize: true,
gap: 4 gap: 4
@ -294,7 +294,7 @@
}). }).
on('focus.a click.a', _selector, toggle). on('focus.a click.a', _selector, toggle).
on('change.a', _selector, function() { on('change.a', _selector, function() {
_color.setColor(this.value); _color.setColor(this.value || 'rgb');
_instance.colorPicker.render(); _instance.colorPicker.render();
}); });

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save