Browse Source

Show what the JS component file name is on the section header if available

Josh Engebretson 10 years ago
parent
commit
c440467852
1 changed files with 13 additions and 1 deletions
  1. 13 1
      Script/AtomicEditor/ui/frames/inspector/ComponentInspector.ts

+ 13 - 1
Script/AtomicEditor/ui/frames/inspector/ComponentInspector.ts

@@ -36,7 +36,19 @@ class ComponentInspector extends Atomic.UISection {
     inspect(component: Atomic.Component) {
     inspect(component: Atomic.Component) {
 
 
         this.component = component;
         this.component = component;
-        this.text = component.getTypeName();
+        this.text = component.typeName;
+
+        // For JSComponents append the filename
+        if (component.typeName == "JSComponent") {
+
+            var jsc = <Atomic.JSComponent> component;
+
+            if (jsc.componentFile) {
+              var pathInfo = Atomic.splitPath( jsc.componentFile.name);
+              this.text = "JS - " + pathInfo.fileName;
+            }
+
+        }
 
 
         // don't expand by default
         // don't expand by default
         this.value = 0;
         this.value = 0;