Add floating imagery window
[potlatch2.git] / net / systemeD / potlatch2 / controller / ControllerState.as
index fa73da2d0f1ab9888364812180790703d9b12dac..eebb743d5f5256d5c62e6041ce223ba7d18c52dd 100644 (file)
@@ -291,11 +291,12 @@ package net.systemeD.potlatch2.controller {
                /** Create an action to add "source=*" tag to current entity based on background imagery. This is a convenient shorthand for users. */
                protected function setSourceTag():void {
                        if (selectCount!=1) { return; }
                /** Create an action to add "source=*" tag to current entity based on background imagery. This is a convenient shorthand for users. */
                protected function setSourceTag():void {
                        if (selectCount!=1) { return; }
-                       if (!Imagery.instance().selected) { return; }
-                       var sourceTag:String = Imagery.instance().selected.sourcetag || Imagery.instance().selected.id || Imagery.instance().selected.name;
+                       var bg:Object=controller.map.tileset.selected;
+                       if (!bg) { return; }
+                       var sourceTag:String = bg.sourcetag || bg.id || bg.name;
                        if (sourceTag=='None') { return; }
                        if ("sourcekey" in Imagery.instance().selected) {
                        if (sourceTag=='None') { return; }
                        if ("sourcekey" in Imagery.instance().selected) {
-                           firstSelected.setTag(Imagery.instance().selected.sourcekey, sourceTag, MainUndoStack.getGlobalStack().addAction);
+                           firstSelected.setTag(bg.sourcekey, sourceTag, MainUndoStack.getGlobalStack().addAction);
                        } else {
                            firstSelected.setTag('source', sourceTag, MainUndoStack.getGlobalStack().addAction);
                        }
                        } else {
                            firstSelected.setTag('source', sourceTag, MainUndoStack.getGlobalStack().addAction);
                        }