flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [04/50] [abbrv] git commit: [flex-asjs] [refs/heads/core_js_to_as] - don't dispatch change event if nothing changed
Date Thu, 08 Oct 2015 18:51:06 GMT
don't dispatch change event if nothing changed


Project: http://git-wip-us.apache.org/repos/asf/flex-asjs/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-asjs/commit/2e43d443
Tree: http://git-wip-us.apache.org/repos/asf/flex-asjs/tree/2e43d443
Diff: http://git-wip-us.apache.org/repos/asf/flex-asjs/diff/2e43d443

Branch: refs/heads/core_js_to_as
Commit: 2e43d44398eb643d6de51020d0ea7949e3388f5d
Parents: c9bd62d
Author: Alex Harui <aharui@apache.org>
Authored: Tue Sep 8 23:20:25 2015 -0700
Committer: Alex Harui <aharui@apache.org>
Committed: Thu Sep 10 14:14:16 2015 -0700

----------------------------------------------------------------------
 .../src/org/apache/flex/html/beads/models/ArraySelectionModel.as | 4 ++++
 1 file changed, 4 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-asjs/blob/2e43d443/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
index cf692fc..2e655a4 100644
--- a/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
+++ b/frameworks/projects/HTML/as/src/org/apache/flex/html/beads/models/ArraySelectionModel.as
@@ -138,6 +138,8 @@ package org.apache.flex.html.beads.models
          */
 		public function set selectedIndex(value:int):void
 		{
+            if (value === _selectedIndex) return;
+            
 			_selectedIndex = value;
 			_selectedItem = (value == -1 || _dataProvider == null) ? null : (value < _dataProvider.length)
? _dataProvider[value] : null;
 			dispatchEvent(new Event("selectedIndexChanged"));			
@@ -185,6 +187,8 @@ package org.apache.flex.html.beads.models
          */
 		public function set selectedItem(value:Object):void
 		{
+            if (value === _selectedItem) return;
+            
 			_selectedItem = value;	
 			var n:int = _dataProvider.length;
 			for (var i:int = 0; i < n; i++)


Mime
View raw message