+
+@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) {
+ var hexVal = '#' + this.color.colors.HEX;
+ var rgb = this.color.colors.RND.rgb;
+ var rgbLightVal = 'rgba('+ [rgb.r, rgb.g, rgb.b, '0.15'].join(',') +')';
+ // Set textbox color to hex color code.
+ var isEmpty = $.trim($elm.val()).length === 0;
+ if (!isEmpty) $elm.val(hexVal);
+ $('#setting-app-color-light').val(isEmpty ? '' : rgbLightVal);
+
+ var customStyles = document.getElementById('custom-styles');
+ var oldColor = customStyles.getAttribute('data-color');
+ var 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