[Mapbender-commits] r8866 - trunk/mapbender/http/plugins
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu May 15 04:29:41 PDT 2014
Author: hwbllmnn
Date: 2014-05-15 04:29:41 -0700 (Thu, 15 May 2014)
New Revision: 8866
Modified:
trunk/mapbender/http/plugins/mb_digitize_widget.php
Log:
open edit dialog/edit mode when selecting object by click
Modified: trunk/mapbender/http/plugins/mb_digitize_widget.php
===================================================================
--- trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-15 11:10:13 UTC (rev 8865)
+++ trunk/mapbender/http/plugins/mb_digitize_widget.php 2014-05-15 11:29:41 UTC (rev 8866)
@@ -195,7 +195,10 @@
$('#mapframe1').bind('kml:loaded', function(evt, item) {
var url = item.url;
$('li[title="' + url + '"] > a').live('contextmenu', contextmenuLayer);
- $('li[title="' + url + '"] > ul > li').live('contextmenu', contextmenuObject);
+ $('li[title="' + url + '"] > ul > li').live('contextmenu', contextmenuObject)
+ .live('click', function() {
+ editObject($(this), null)();
+ });
$('li[title="' + url + '"] > .digitize-menu-arrow').live('click', contextmenuLayer);
$('li[title="' + url + '"] > ul > li > .digitize-menu-arrow').live('click', contextmenuObject);
});
@@ -270,6 +273,7 @@
var editObject = function($link, menu) {
return function() {
+ editDialog.find().unbind();
$link.addClass('kmltree-selected').siblings().removeClass('kmltree-selected');
var idx = $link.attr('idx');
var kml = $('#mapframe1').data('kml');
@@ -306,7 +310,8 @@
var preview = editDialog.find('.digitize-preview').html('').get(0);
kml.renderPreview(feature, preview);
- menu.menu('destroy').remove();
+ if(menu)
+ menu.menu('destroy').remove();
};
};
@@ -433,6 +438,8 @@
o.type = status.match(/new-(.+)/)[1];
o.$target
.mb_digitize(o)
+ .unbind('mb_digitizelastpointadded')
+ .unbind('mb_digitizereinitialize')
.bind("mb_digitizelastpointadded", finishDigitize)
.bind("mb_digitizereinitialize", reinitializeDigitize);
}
@@ -442,6 +449,7 @@
o.editedFeature = editedFeature;
o.$target
.mb_digitize(o)
+ .unbind('mb_digitizefeaturemodified')
.bind('mb_digitizefeaturemodified', featureModified);
}
}
@@ -453,7 +461,7 @@
this.destroy = function () {
if (o.$target.size() > 0) {
o.$target.mb_digitize("destroy")
-// .unbind("mb_digitizepointadded", newPoint)
+ // .unbind("mb_digitizepointadded", newPoint)
.unbind("mb_digitizelastpointadded", finishDigitize)
.unbind("mb_digitizereinitialize", reinitializeDigitize);
}
@@ -461,9 +469,9 @@
digitizeDialog.dialog("close");
}
- //remove digitized x and y values from print dialog
- $('input[name="digitized_x_values"]').val("");
- $('input[name="digitized_y_values"]').val("");
+ //remove digitized x and y values from print dialog
+ $('input[name="digitized_x_values"]').val("");
+ $('input[name="digitized_y_values"]').val("");
};
this.deactivate = function () {
More information about the Mapbender_commits
mailing list