{"issue":{"created_at":"2011-12-09T09:06:49Z","state":"open","updated_at":"2011-12-09T09:25:30Z","comments":1,"user":{"gravatar_id":"452b8f9025ae0f55b409f448110d83d3","id":192946,"url":"https://api.github.com/users/matzke","avatar_url":"https://secure.gravatar.com/avatar/452b8f9025ae0f55b409f448110d83d3?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"matzke"},"body":"Sometimes you don't want to loose focus, when the user clickes outside the table so make this optional ;-) I would commit the code myself, but I'm still using SVN ...\r\n\r\n* put code in separate function\r\n\r\n```javascript\r\n  /*\r\n   * Function: _fnLooseFocus\r\n   * Purpose:  Loose table focus when click outside the table\r\n   * Returns:  -\r\n   */\r\n  function _fnLooseFocus()\r\n  {\r\n    jQuery(document).click( function(e) {\r\n      var nTarget = e.target;\r\n      var bTableClick = false;\r\n      while ( nTarget )\r\n      {\r\n        if ( nTarget == oInit.table )\r\n        {\r\n          bTableClick = true;\r\n          break;\r\n        }\r\n        nTarget = nTarget.parentNode;\r\n      }\r\n      if ( !bTableClick )\r\n      {\r\n        _fnBlur();\r\n      }\r\n    } );\r\n  }  \r\n```\r\n* in function _fnInit add\r\n\r\n```javascript\r\n    if ( typeof oInit.looseFocus == 'undefined' ) {\r\n      oInit.looseFocus = true;\r\n    }\r\n\r\n    if ( oInit.looseFocus == true ) {\r\n      _fnLooseFocus();\r\n    }\r\n```\r\n\r\n","assignee":null,"id":2499621,"labels":[],"pull_request":{"patch_url":null,"html_url":null,"diff_url":null},"number":6,"title":"loose focus - optional","closed_at":null,"html_url":"https://github.com/DataTables/KeyTable/issues/6","url":"https://api.github.com/repos/DataTables/KeyTable/issues/6","milestone":null},"action":"created","comment":{"created_at":"2011-12-09T09:25:30Z","updated_at":"2011-12-09T09:25:30Z","user":{"gravatar_id":"8b1feb7f958da6bb957ed650fdb0fae0","id":278219,"url":"https://api.github.com/users/DataTables","avatar_url":"https://secure.gravatar.com/avatar/8b1feb7f958da6bb957ed650fdb0fae0?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","login":"DataTables"},"body":"That's a good one - like that. I'll include that shortly.\r\n\r\nThanks!","id":3076910,"url":"https://api.github.com/repos/DataTables/KeyTable/issues/comments/3076910"}}