소스 검색

Merge pull request #3859 from GordonSmith/HPCC-8567

HPCC-8567 ECLPlayground Sample Drop Down Error

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 12 년 전
부모
커밋
4000bc385c
1개의 변경된 파일16개의 추가작업 그리고 12개의 파일을 삭제
  1. 16 12
      esp/files/scripts/GraphControl.js

+ 16 - 12
esp/files/scripts/GraphControl.js

@@ -143,23 +143,27 @@ define([
 		},
 
 		centerOn: function (globalID) {
-			var item = this.obj.getItem(globalID);
-			this.obj.centerOnItem(item, true);
-			var items = [item];
-			this.obj.setSelected(items, true);
+			if (this.obj) {
+				var item = this.obj.getItem(globalID);
+				this.obj.centerOnItem(item, true);
+				var items = [item];
+				this.obj.setSelected(items, true);
+			}
 		},
 
 		watchSelect: function (select) {
-			if (sniff("chrome") && select) {
-				var context = this;
+			if (this.obj) {
+				if (sniff("chrome") && select) {
+					var context = this;
 
-				aspect.before(select, "openDropDown", function () {
-					dojo.style(context.obj, "height", "0px");
-				});
+					aspect.before(select, "openDropDown", function () {
+						dojo.style(context.obj, "height", "0px");
+					});
 
-				aspect.after(select, "closeDropDown", function (focus) {
-					dojo.style(context.obj, "height", "100%");
-				});
+					aspect.after(select, "closeDropDown", function (focus) {
+						dojo.style(context.obj, "height", "100%");
+					});
+				}
 			}
 		},