diff options
author | Christian Vogeley <christian.vogeley@hotmail.de> | 2014-03-25 19:36:44 +0100 |
---|---|---|
committer | Christian Vogeley <christian.vogeley@hotmail.de> | 2014-03-25 19:36:44 +0100 |
commit | 51ee3964c0f799fa9786ddd85b54707c43cd3509 (patch) | |
tree | aab2616b9e69bfe2bf2b32070aba71a5cb24f76f /library/bootstrap-colorpicker/src/js/docs.js | |
parent | c972a94b0125bcb82ef3fe8e97adef45f94404f2 (diff) | |
download | volse-hubzilla-51ee3964c0f799fa9786ddd85b54707c43cd3509.tar.gz volse-hubzilla-51ee3964c0f799fa9786ddd85b54707c43cd3509.tar.bz2 volse-hubzilla-51ee3964c0f799fa9786ddd85b54707c43cd3509.zip |
Well, if you want to add a color picker it is indeed a good idea
to include the color picker.
Diffstat (limited to 'library/bootstrap-colorpicker/src/js/docs.js')
-rw-r--r-- | library/bootstrap-colorpicker/src/js/docs.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/library/bootstrap-colorpicker/src/js/docs.js b/library/bootstrap-colorpicker/src/js/docs.js new file mode 100644 index 000000000..29cbbd2bc --- /dev/null +++ b/library/bootstrap-colorpicker/src/js/docs.js @@ -0,0 +1,45 @@ +$(function() { + // Code for docs demos + function createColorpickers() { + // Api demo + var bodyStyle = $('body')[0].style; + $('#demo_apidemo').colorpicker({ + color: bodyStyle.backgroundColor + }).on('changeColor', function(ev) { + bodyStyle.backgroundColor = ev.color.toHex(); + }); + + // Horizontal mode + $('#demo_forceformat').colorpicker({ + format: 'rgba', // force this format + horizontal: true + }); + + $('.demo-auto').colorpicker(); + + // Disabled / enabled triggers + $(".disable-button").click(function(e) { + e.preventDefault(); + $("#demo_endis").colorpicker('disable'); + }); + + $(".enable-button").click(function(e) { + e.preventDefault(); + $("#demo_endis").colorpicker('enable'); + }); + } + + createColorpickers(); + + // Create / destroy instances + $('.demo-destroy').click(function(e) { + e.preventDefault(); + $('.demo').colorpicker('destroy'); + $(".disable-button, .enable-button").off('click'); + }); + + $('.demo-create').click(function(e) { + e.preventDefault(); + createColorpickers(); + }); +}); |