modal oppdatert med aa close fuksjon
authorRoza Moustafa <roza.92m@hotmail.com>
Thu, 3 Dec 2015 12:07:09 +0000 (13:07 +0100)
committerRoza Moustafa <roza.92m@hotmail.com>
Thu, 3 Dec 2015 12:07:09 +0000 (13:07 +0100)
src/components/map/map.html
src/components/map/map.ts

index f64b914..b8ec9b9 100644 (file)
@@ -1,19 +1,20 @@
 <div id="map"></div>
 
-<div id="divModal">
+<!--<div id="divModal">-->
+    <div class="show" id="divModal" role="dialog">
     <div class="modal-dialog modal-sm">
         <div class="modal-content">
             <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal">&times;</button>
+                <button type="button" class="close" (click)="closeModal()">&times;</button>
                 <h4 class="modal-title">Modal Header</h4>
             </div>
             <div class="modal-body">
                 <p>This is a small modal.</p>
             </div>
             <div class="modal-footer">
-                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
+                <button type="button" class="btn btn-default"  (click)="addUnit()">Close</button>
             </div>
         </div>
     </div>
-</div>
-
+        </div>
+<!--</div>-->
index 7c97058..329fc73 100644 (file)
@@ -40,6 +40,12 @@ export class Map {
         return this.hideModal = document.getElementById("divModal").style.visibility = "visible";
     }
 
+    closeModal(){
+        console.log("hei");
+        return this.hideModal = document.getElementById("divModal").style.visibility = "hidden";
+
+    }
+
     getMap() {
         return this.map;
     }
@@ -223,7 +229,6 @@ export class Map {
                     });
 
                     marker.setMap(instance.map);
-
                     instance.showModal();
 
 
@@ -261,6 +266,7 @@ export class Map {
     }
 
     addUnit() {
+        console.log("her")
         let parent = this.getParent();
         let pos = this.getcurrentPos();
         let lat = pos.lat();