From a84eed3b19b34b46e21ad2a95291c96de748a504 Mon Sep 17 00:00:00 2001 From: Matthias Schmidt Date: Sun, 31 Mar 2013 19:47:58 +0200 Subject: [PATCH] Adds change event trigger for ColorPicker if color is updated If you want to use the color picker to select a color for an element that is currently visible, it might be nice to update the color of the element "live", i.e. each time the user updates the selected color, the element gets the new color. Currently, there is no way to detect when the user has changed the selected color. Now, they can simply listen to the `change` event of the input field. --- wcfsetup/install/files/js/WCF.ColorPicker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/WCF.ColorPicker.js b/wcfsetup/install/files/js/WCF.ColorPicker.js index 5a68080257..e9134ecb40 100644 --- a/wcfsetup/install/files/js/WCF.ColorPicker.js +++ b/wcfsetup/install/files/js/WCF.ColorPicker.js @@ -267,7 +267,7 @@ WCF.ColorPicker = Class.extend({ g: this._rgba.g.val(), b: this._rgba.b.val() }); - $('#' + $element.data('store')).val('rgba(' + this._rgba.r.val() + ', ' + this._rgba.g.val() + ', ' + this._rgba.b.val() + ', ' + (this._rgba.a.val() / 100) + ')'); + $('#' + $element.data('store')).val('rgba(' + this._rgba.r.val() + ', ' + this._rgba.g.val() + ', ' + this._rgba.b.val() + ', ' + (this._rgba.a.val() / 100) + ')').trigger('change'); this._dialog.wcfDialog('close'); }, -- 2.20.1