From d36f7f9dfe0a16b8b3d5be640ee902918607fe4b Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Fri, 12 Feb 2010 15:33:00 +0100 Subject: [PATCH] Only show map link if the is a location. Tweak edit form. --- kronolith/js/kronolith.js | 16 +++++++++++++--- kronolith/templates/index/edit.inc | 23 +++++++++++++---------- 2 files changed, 26 insertions(+), 13 deletions(-) diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 6d3c0a5ed..12cfb4ff7 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -2483,10 +2483,16 @@ KronolithCore = { keyupHandler: function(e) { - /* - if (e.element().readAttribute('id') == 'foo') { + switch (e.element().readAttribute('id')) { + case 'kronolithEventLocation': + if ($F('kronolithEventLocation')) { + $('kronolithEventMapLink').show(); + } else { + $('kronolithEventMapLink').hide(); + } + return; } - */ + }, clickHandler: function(e, dblclick) @@ -3238,6 +3244,7 @@ KronolithCore = { this.toggleAllDay(false); $('kronolithEventForm').enable(); $('kronolithEventForm').reset(); + $('kronolithEventMapLink').hide(); $('kronolithEventSave').show(); $('kronolithEventDelete').show(); $('kronolithEventForm').down('.kronolithFormActions').down('.kronolithSep').show(); @@ -3370,6 +3377,9 @@ KronolithCore = { $('kronolithEventTarget').setValue(ev.ty + '|' + ev.c); $('kronolithEventTitle').setValue(ev.t); $('kronolithEventLocation').setValue(ev.l); + if (ev.l) { + $('kronolithEventMapLink').show(); + } $('kronolithEventUrl').setValue(ev.u); $('kronolithEventAllday').setValue(ev.al); this.toggleAllDay(ev.al); diff --git a/kronolith/templates/index/edit.inc b/kronolith/templates/index/edit.inc index 69f0a2894..785aa31a3 100644 --- a/kronolith/templates/index/edit.inc +++ b/kronolith/templates/index/edit.inc @@ -11,17 +11,20 @@
- +
- - + - - - - · + + +
@@ -31,7 +34,7 @@
- -