[Mapbender-commits] r8852 - trunk/mapbender/http/plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue May 13 02:13:45 PDT 2014


Author: hwbllmnn
Date: 2014-05-13 02:13:45 -0700 (Tue, 13 May 2014)
New Revision: 8852

Modified:
   trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
added adding attributes when editing features


Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-13 09:01:49 UTC (rev 8851)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php	2014-05-13 09:13:45 UTC (rev 8852)
@@ -234,11 +234,20 @@
                     rows += '<tr><td>' + k + '</td><td><input type="text" name="' + k + '" value="' + v + '"></input></td></tr>';
                 });
                 attributesDialog.find('table').html(rows);
+                attributesDialog.find('.digitize-add').bind('click', function() {
+                    var newRow = $('<tr><td><input type="text"></input></td><td><input type="text"></input></td></tr>');
+                    attributesDialog.find('table').append(newRow);
+                    newRow.find('input').first().bind('change', function() {
+                        newRow.find('input').last().attr('name', $(this).val());
+                    });
+                });
                 attributesDialog.find('.digitize-save').bind('click', function() {
                     attributesDialog.find('table input').each(function() {
                         var k = $(this).attr('name');
                         var v = $(this).val();
-                        feature.properties[k] = v;
+                        if(k) {
+                            feature.properties[k] = v;
+                        }
                     });
                     attributesDialog.dialog('close');
                     editDialog.dialog('close');



More information about the Mapbender_commits mailing list