If you edit a field and then click on an other page element the edit field does not close itself. This is because

    $(element).find(':input').blur(function() {
      Drupal.editablefields.onblur(this);
    });

doesn't hand over the correct object to onblur.

Fixed this by replacing this by element.

Tested with Drupal 6.15, a clean checkout from cvs and Firefox and Safari on a Mac.

CommentFileSizeAuthor
editablefields_onblur.patch1.2 KBstborchert

Comments

andreiashu’s picture

Version: 6.x-2.x-dev » 6.x-3.x-dev
Status: Needs review » Fixed

Hi,
This is fixed in 6--3 dev branch.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

abaddon’s picture

Version: 6.x-3.x-dev » 6.x-2.x-dev

it should be ported to 2.x as well, to the stable release, its a simple fix and it works for me

abaddon’s picture

Status: Closed (fixed) » Active
abaddon’s picture

the problem is actually in Drupal.editablefields.onblur handler, when checking the parents class it should use .length or it will always fail, this is coupled with the first patch because "this" has the event and not what "this" is at the time of the event scheduling.. or you could create another var to hold it.. works either way

--- editablefields/editablefields.js  2011-02-11 11:49:43.000000000 +0200
+++ editablefields/.htdist_editablefields.js  2011-01-24 05:05:54.000000000 +0200
@@ -257,7 +257,7 @@ Drupal.editablefields.onchange = functio

 Drupal.editablefields.onblur = function(element) {
   // the matrix field should not close when leaving any of its textboxes.
-  if ($(element).parents('table.matrix').length) {
+  if ($(element).parents('table.matrix')) {
     return false;
   }
rjbrown99’s picture

#5 I think your patch is showing it backwards, no? IE the .length line should be + and the other line should be -.

lunk rat’s picture

Is there a final way to patch the 6.x-2.x-dev version to fix the onblur so that it closes fields after the cursor leaves the field?

joelpittet’s picture

Issue summary: View changes
Status: Active » Closed (outdated)

Closing this to triage the queue. Feel free to comment if you'd like this to be re-opened, though currently there is nobody supporting the 6.x branch.