diff --git a/static/js/stream_color.js b/static/js/stream_color.js index c276ec8282..3ade5dc5f9 100644 --- a/static/js/stream_color.js +++ b/static/js/stream_color.js @@ -99,7 +99,20 @@ export function update_stream_color(sub, color, {update_historical = false} = {} message_view_header.colorize_message_view_header(); } +export const sidebar_popover_colorpicker_options_full = { + clickoutFiresChange: false, + showPalette: true, + showInput: true, + flat: true, + cancelText: "", + chooseText: $t({defaultMessage: "Confirm"}), + palette: stream_color_palette, + change: picker_do_change_color, +}; + function picker_do_change_color(color) { + $(".colorpicker").spectrum("destroy"); + $(".colorpicker").spectrum(sidebar_popover_colorpicker_options_full); const stream_id = Number.parseInt($(this).attr("stream_id"), 10); const hex_color = color.toHexString(); stream_settings_ui.set_color(stream_id, hex_color); @@ -115,14 +128,3 @@ export const sidebar_popover_colorpicker_options = { palette: stream_color_palette, change: picker_do_change_color, }; - -export const sidebar_popover_colorpicker_options_full = { - clickoutFiresChange: false, - showPalette: true, - showInput: true, - flat: true, - cancelText: "", - chooseText: $t({defaultMessage: "Confirm"}), - palette: stream_color_palette, - change: picker_do_change_color, -};