# Above lines and this line are ignored by the patching process.
Index: js/node_form.js
--- js/node_form.js Base (BASE)
+++ js/node_form.js Locally Modified (Based On LOCAL)
@@ -40,14 +40,14 @@
     // Build a wrapper for the extra buttons.
     var $buttonsWrapper = $('<div class="noderelationships-nodereference-buttons-wrapper"/>');
     $nodereference.after($buttonsWrapper);
-
     // Install the "View on new window" button.
     if (fieldOptions.searchUrl || fieldOptions.createUrl || fieldOptions.missingTranslations) {
       var $viewButton = $(Drupal.theme('nodeRelationshipsReferenceButton', 'view', Drupal.t('View on new window...')));
       $viewButton.attr('target', 'blank');
       $buttonsWrapper.append($viewButton);
-      $nodereference.bind('change', function() {
         var nid = self.getNid($nodereference.val());
+      $nodereference.bind('change', function() {
+        nid = self.getNid($nodereference.val());
         $viewButton.attr('href', (nid > 0 ? settings.viewUrl.replace(/\/nid/, '/'+ nid) : 'javascript:void(0)'));
         if (nid > 0) {
           if ($viewButton.hasClass('noderelationships-nodereference-view-disabled')) {
@@ -63,7 +63,11 @@
         $nodereference.trigger('change');
       }).trigger('change');
       $viewButton.bind('click', function() {
-        return (self.getNid($nodereference.val()) > 0);
+        if (nid > 0) {
+          self.loadFieldValues(fieldOptions, $nodereference, false);
+          self.openDialog(fieldOptions.editUrl + '/' + nid, fieldOptions, $nodereference);
+        }
+        return false;
       }).bind('focus', function() {
         $nodereference.trigger('change');
       });
Index: noderelationships.pages.inc
--- noderelationships.pages.inc Base (BASE)
+++ noderelationships.pages.inc Locally Modified (Based On LOCAL)
@@ -323,6 +323,10 @@
   $noderef_settings = noderelationships_settings_load($referrer_type, 'noderef');
   $create_or_translate_enabled = (isset($noderef_settings['create_and_reference'][$field_name]) || (isset($noderef_settings['translate_and_reference'][$field_name]) && noderelationships_translation_supported_type($referrer_type)));
 
+  if ($mode == 'edit') {
+    $content = noderelationships_noderef_page_edit($referrer_type, $field_name, $arg);
+  }
+
   if ($mode == 'create' && $create_or_translate_enabled) {
     $content = noderelationships_noderef_page_create($referrer_type, $field_name, $arg);
     if (!empty($content)) {
@@ -415,6 +419,22 @@
 }
 
 /**
+ * Build the edit page.
+ *
+ */
+function noderelationships_noderef_page_edit($referrer_type, $field_name, $new_type) {
+  $reference_fields = noderelationships_get_reference_fields($referrer_type);
+
+  if (isset($reference_fields[$field_name])) {
+    $_GET['noderelationships_referrer_type'] = $referrer_type;
+    $_GET['noderelationships_field_name'] = $field_name;
+    $query = drupal_query_string_encode($_GET, array('q'));
+    unset($_REQUEST['destination'], $_REQUEST['edit']['destination']);
+    drupal_goto('node/'. str_replace('_', '-', $new_type) . '/edit', $query);
+  }
+}
+
+/**
  * Get the translation page title.
  *
  * @see translation_nodeapi()
@@ -593,6 +613,8 @@
       $field_creatable_types = array_intersect($creatable_types, $reference_fields[$field_name]);
       if (!empty($field_creatable_types)) {
         $field_settings[$field_name]['createUrl'] = url('noderelationships/create/'. $type_name .'/'. $field_name);
+        // I only use the createUrl so for my case, this is the best place to set this setting
+        $field_settings[$field_name]['editUrl'] = url('noderelationships/edit/'. $type_name .'/'. $field_name);
       }
     }
   }
Index: noderelationships.system.inc
--- noderelationships.system.inc Base (BASE)
+++ noderelationships.system.inc Locally Modified (Based On LOCAL)
@@ -166,6 +166,14 @@
     'type' => MENU_CALLBACK,
     'file' => 'noderelationships.pages.inc',
   );
+  $items['noderelationships/edit'] = array(
+    'title' => 'Edit reference',
+    'page callback' => 'noderelationships_noderef_page',
+    'page arguments' => array(1),
+    'access callback' => '_node_add_access', //This is OK in my case
+    'type' => MENU_CALLBACK,
+    'file' => 'noderelationships.pages.inc',
+  );
   $items['noderelationships/ahah/search'] = array(
     'title' => 'Search and reference',
     'page callback' => 'noderelationships_noderef_ahah_search',
