Commit 5bf1f955 by Uros Spasojevic

-added placeholders for updating markers

-added buttons for updating and deleting
parent f97f0a91
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -15,10 +15,10 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -15,10 +15,10 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
component: { component: {
'evoksi': { 'evoksi': {
markerClick: function (marker) { markerClick: function (marker) {
Ext.create('Ext.window.Window', { var win = Ext.create('Ext.window.Window', {
title: marker.title, // Marker title title: marker.title == "" ? "New event" : marker.title, // Marker title
height: 600, height: 600,
width: 1000, width: '70%',
modal: true, modal: true,
layout: 'border', layout: 'border',
maximizable: true, maximizable: true,
...@@ -30,24 +30,60 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -30,24 +30,60 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
width: 300, width: 300,
center: { center: {
lat: marker.lat, // Marker latitude lat: marker.lat, // Marker latitude
lng: marker.lng, // Marker longitude lng: marker.lng // Marker longitude
marker: {
title: marker.title
}
}, },
markers: [
{
lat: marker.lat,
lng: marker.lng,
animation: google.maps.Animation.BOUNCE
}
],
mapOptions: { mapOptions: {
mapTypeId: google.maps.MapTypeId.ROADMAP, mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 10 zoom: 15
} }
}, },
{ {
xtype: 'container', xtype: 'panel',
region: 'center', region: 'center',
layout: 'fit', layout: 'vbox',
style: 'background-color: white;',
items: [ items: [
{ {
xtype: 'uxiframe', xtype: 'textfield',
src: marker.url // Marker URL fieldLabel: 'Title',
reference: 'titleField',
value: marker.title,
width: '90%'
},
{
xtype: 'textarea',
fieldLabel: 'Description',
reference: 'descriptionArea',
value: marker.description,
width: '90%'
}
],
buttons: [
{
text: 'Update',
handler: function() {
// console.log(win.items.items[0].value);
// var description = win.items.items[0].value;
// marker.title = title;
// marker.description = description;
// this.fireEvent('updateData', marker);
// win.close();
console.log('updating');
}
},
{
text: 'Delete',
handler: function() {
console.log('deleting');
}
} }
] ]
} }
...@@ -83,6 +119,32 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', { ...@@ -83,6 +119,32 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
markers.push(map.addMarker(marker)); markers.push(map.addMarker(marker));
}, },
updateData: function(marker) {
var updates = {};
var newMark = {
access: marker.access,
lat: marker.lat,
lng: marker.lng,
animation: google.maps.Animation.DROP,
title: marker.title,
description: marker.description
};
var i = markers.length;
while(i) {
i--;
if(markers[i].access == marker.access) {
markers[i].title = marker.title;
markers[i].description = marker.description;
}
}
updates['/data/'+marker.access] = newMark;
dbref.ref().update(updates);
},
mapready: function() { mapready: function() {
var me = this; var me = this;
var map = me.getView(); var map = me.getView();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment