-
-@section('scripts')
- <script src="{{ baseUrl("/libs/jq-color-picker/tiny-color-picker.min.js?version=1.0.0") }}"></script>
- <script type="text/javascript">
- $('#setting-app-color').colorPicker({
- opacity: false,
- renderCallback: function($elm, toggled) {
- const hexVal = '#' + this.color.colors.HEX;
- const rgb = this.color.colors.RND.rgb;
- const rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
-
- // Set textbox color to hex color code.
- const isEmpty = $.trim($elm.val()).length === 0;
- if (!isEmpty) $elm.val(hexVal);
- $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
-
- const customStyles = document.getElementById('custom-styles');
- const oldColor = customStyles.getAttribute('data-color');
- const oldColorLight = customStyles.getAttribute('data-color-light');
-
- customStyles.innerHTML = customStyles.innerHTML.split(oldColor).join(hexVal);
- customStyles.innerHTML = customStyles.innerHTML.split(oldColorLight).join(rgbLightVal);
-
- customStyles.setAttribute('data-color', hexVal);
- customStyles.setAttribute('data-color-light', rgbLightVal);
- }
- });
- </script>
-@stop
\ No newline at end of file