X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=root%2Fjs%2Frelationship.js;h=6e4295b2f6d883e1355040a3743ab3070199baf7;hb=a166dca8c7ea6f667181841bd25905b55901df76;hp=873945b3caca76130883ad4782a0eb1f4eb58536;hpb=21e6ebc7ffd87340286aa4ee5d4df1057bac6a3b;p=scpubgit%2Fstemmaweb.git
diff --git a/root/js/relationship.js b/root/js/relationship.js
index 873945b..6e4295b 100644
--- a/root/js/relationship.js
+++ b/root/js/relationship.js
@@ -682,12 +682,21 @@ $(document).ready(function () {
},
create: function(event, ui) {
$(this).data( 'relation_drawn', false );
+ $('#rel_type').data( 'changed_after_open', false );
$.each( relationship_types, function(index, typedef) {
$('#rel_type').append( $('').attr( "value", typedef.name ).text(typedef.name) );
});
$.each( relationship_scopes, function(index, value) {
$('#scope').append( $('').attr( "value", value ).text(value) );
- });
+ });
+ // Handler to clear the annotation field, the first time the relationship is
+ // changed after opening the form.
+ $('#rel_type').change( function () {
+ if( !$(this).data( 'changed_after_open' ) ) {
+ $('#note').val('');
+ }
+ $(this).data( 'changed_after_open', true );
+ });
},
open: function() {
relation_manager.create_temporary( $('#source_node_id').val(), $('#target_node_id').val() );
@@ -696,6 +705,7 @@ $(document).ready(function () {
$("#dialog_overlay").height( $("#enlargement_container").height() );
$("#dialog_overlay").width( $("#enlargement_container").innerWidth() );
$("#dialog_overlay").offset( $("#enlargement_container").offset() );
+ $('#rel_type').data( 'changed_after_open', false );
},
close: function() {
relation_manager.remove_temporary();