fix minor breakage
[potlatch2.git] / potlatch2.mxml
index b340a7e..660b8d9 100755 (executable)
 
                        // create GPS trackloader
                        trackLoader=new TrackLoader(theMap,conn.apiBase);
+
+            // show help dialog on startup, if required
+            // show_help == always => on every startup
+            // show_help == once => show on first startup only
+            var show_help:String = loaderInfo.parameters["show_help"];
+
+            if (show_help == 'always' || (show_help == 'once' && obj.data["help_shown"] != "true")) {
+              new HelpDialog().init();
+            }
                }
                
                public function onMapError(event:MapEvent):void {
                }
         private function onDataDirty(event:Event):void {
                        saveButton.enabled=true;
+            if (ExternalInterface.available) {
+              ExternalInterface.call("markChanged", false);
+            }
                }
                private function onDataClean(event:Event):void {
                        saveButton.enabled=false;
+            if (ExternalInterface.available) {
+              ExternalInterface.call("markChanged", true);
+            }
                }
                
         private function onImageryLoad(event:Event):void {
                     break;
                                }
                        }
-            if (!isSet && theController.stylesheets.length > 0) {
+            if (!isSet) {
+              if(theController.stylesheets.length > 0) {
                 var s:Object = theController.stylesheets[0];
                 setStylesheet(s['label'], s['data']);
-            } else {
+              } else {
                 //hit and hope. FIXME should this be an error state?
                 theController.stylesheets.push({ label:'Potlatch', data:'potlatch.css'});
                 setStylesheet('Potlatch','potlatch.css');
+              }
             }
                }