You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/12/11 08:20:54 UTC
[royale-asjs] branch develop updated: ComboBoxListCloseOnClick: add
a bit more of info and organize imports
This is an automated email from the ASF dual-hosted git repository.
carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git
The following commit(s) were added to refs/heads/develop by this push:
new 88e76bf ComboBoxListCloseOnClick: add a bit more of info and organize imports
88e76bf is described below
commit 88e76bf4a1e1fa440aa4b19b7eecce313ed92404
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Fri Dec 11 09:20:41 2020 +0100
ComboBoxListCloseOnClick: add a bit more of info and organize imports
---
.../controls/combobox/ComboBoxListCloseOnClick.as | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxListCloseOnClick.as b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxListCloseOnClick.as
index 374b0f1..6ec5971 100644
--- a/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxListCloseOnClick.as
+++ b/frameworks/projects/Jewel/src/main/royale/org/apache/royale/jewel/beads/controls/combobox/ComboBoxListCloseOnClick.as
@@ -19,18 +19,21 @@
package org.apache.royale.jewel.beads.controls.combobox
{
import org.apache.royale.core.IBead;
- import org.apache.royale.jewel.beads.views.ComboBoxView;
import org.apache.royale.core.IStrand;
+ import org.apache.royale.core.ValuesManager;
+ import org.apache.royale.events.IEventDispatcher;
+ import org.apache.royale.events.MouseEvent;
import org.apache.royale.jewel.ComboBox;
import org.apache.royale.jewel.List;
- import org.apache.royale.events.MouseEvent;
- import org.apache.royale.events.IEventDispatcher;
- import org.apache.royale.core.ValuesManager;
-
+ import org.apache.royale.jewel.beads.views.ComboBoxView;
/**
* The ComboBoxListCloseOnClick bead class is a specialty bead that can be used with
- * a Jewel ComboBox to allow closing ComBox popup in combobox with custom item renderer
+ * a Jewel ComboBox with a custom renderer to allow closing the popup list in when click renderer.
+ *
+ * The default combobox has just a label and the list is closed on click. A Custom renderer
+ * doesn't close by default (we can have complex items with inputs and other controls that we want to clisk and operate),
+ * os is up to the developer add this bead if wants to close the popup list on click
*
* @langversion 3.0
* @playerversion Flash 10.2
@@ -59,12 +62,11 @@ package org.apache.royale.jewel.beads.controls.combobox
var comboBox:ComboBox = (value as ComboBox);
comboView = (comboBox.view as ComboBoxView);
var itemRendererClass:Class = ValuesManager.valuesImpl.getValue(comboView.host, "iItemRenderer") as Class;
- // Apart from checking that the bead is applied to a Jewel ComboBox,
- // it is checked that the combobox has a custom item renderer assigned and that it does not have the SearchFilter bead
- if (comboView && (comboBox.itemRenderer || itemRendererClass != null)){
+ // Checking that the bead is applied to a Jewel ComboBox and has a custom item renderer assigned
+ if (comboView && (comboBox.itemRenderer || itemRendererClass != null)){
(value as IEventDispatcher).addEventListener('popUpOpened', popUpOpenedHandler, false);
(value as IEventDispatcher).addEventListener('popUpClosed', popUpClosedHandler, false);
- }
+ }
}
protected function popUpOpenedHandler():void {