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', {
component: {
'evoksi': {
markerClick: function (marker) {
Ext.create('Ext.window.Window', {
title: marker.title, // Marker title
var win = Ext.create('Ext.window.Window', {
title: marker.title == "" ? "New event" : marker.title, // Marker title
height: 600,
width: 1000,
width: '70%',
modal: true,
layout: 'border',
maximizable: true,
......@@ -30,24 +30,60 @@ Ext.define('Evoksi.view.evoksi.EvoksiController', {
width: 300,
center: {
lat: marker.lat, // Marker latitude
lng: marker.lng, // Marker longitude
marker: {
title: marker.title
}
lng: marker.lng // Marker longitude
},
markers: [
{
lat: marker.lat,
lng: marker.lng,
animation: google.maps.Animation.BOUNCE
}
],
mapOptions: {
mapTypeId: google.maps.MapTypeId.ROADMAP,
zoom: 10
zoom: 15
}
},
{
xtype: 'container',
xtype: 'panel',
region: 'center',
layout: 'fit',
layout: 'vbox',
style: 'background-color: white;',
items: [
{
xtype: 'uxiframe',
src: marker.url // Marker URL
xtype: 'textfield',
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', {
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() {
var me = this;
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