)]}'
{"horizon/static/horizon/js/horizon.forms.js":[{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"ae61442d5e4efafa58fd6036f594bc9d60b7d948","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    });"},{"line_number":169,"context_line":"  }"},{"line_number":170,"context_line":"};"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"horizon.forms.prevent_multiple_submission \u003d function (el) {"},{"line_number":173,"context_line":"  // Disable multiple submissions when launching a form."},{"line_number":174,"context_line":"  var $form \u003d $(el).find(\"form\");"}],"source_content_type":"text/javascript","patch_set":1,"id":"9a1a9d01_64227cbb","line":171,"updated":"2015-09-28 10:49:27.000000000","message":"I think placing another submit preparation activity into this function is justified, but the function name itself has to changed now, because it no longer serves the single purpose.","commit_id":"6cdef349ffaf9ac500637208a28d8fe413f87d00"},{"author":{"_account_id":13686,"name":"Frode Nordahl","email":"fnordahl@ubuntu.com","username":"fnordahl"},"change_message_id":"f02012739a565c762ae6be60ac6c3cb86e35c1a3","unresolved":false,"context_lines":[{"line_number":168,"context_line":"    });"},{"line_number":169,"context_line":"  }"},{"line_number":170,"context_line":"};"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"horizon.forms.prevent_multiple_submission \u003d function (el) {"},{"line_number":173,"context_line":"  // Disable multiple submissions when launching a form."},{"line_number":174,"context_line":"  var $form \u003d $(el).find(\"form\");"}],"source_content_type":"text/javascript","patch_set":1,"id":"9a1a9d01_d9b55831","line":171,"in_reply_to":"9a1a9d01_64227cbb","updated":"2015-09-28 17:52:58.000000000","message":"I agree, done.","commit_id":"6cdef349ffaf9ac500637208a28d8fe413f87d00"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"ae61442d5e4efafa58fd6036f594bc9d60b7d948","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    }"},{"line_number":184,"context_line":"    // Remove disabled attribute on select fields before submit to get value"},{"line_number":185,"context_line":"    // included in POST request."},{"line_number":186,"context_line":"    $(this).find(\u0027select[disabled\u003d\"disabled\"]\u0027).each(function (i, field) {"},{"line_number":187,"context_line":"      var field \u003d $(field);"},{"line_number":188,"context_line":"      field.removeAttr(\"disabled\");"},{"line_number":189,"context_line":"    });"}],"source_content_type":"text/javascript","patch_set":1,"id":"9a1a9d01_04838099","line":186,"updated":"2015-09-28 10:49:27.000000000","message":"The element $form should be used here instead of $(this). We already narrowed the set of elements and should take an advantage of this.","commit_id":"6cdef349ffaf9ac500637208a28d8fe413f87d00"},{"author":{"_account_id":13686,"name":"Frode Nordahl","email":"fnordahl@ubuntu.com","username":"fnordahl"},"change_message_id":"f02012739a565c762ae6be60ac6c3cb86e35c1a3","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    }"},{"line_number":184,"context_line":"    // Remove disabled attribute on select fields before submit to get value"},{"line_number":185,"context_line":"    // included in POST request."},{"line_number":186,"context_line":"    $(this).find(\u0027select[disabled\u003d\"disabled\"]\u0027).each(function (i, field) {"},{"line_number":187,"context_line":"      var field \u003d $(field);"},{"line_number":188,"context_line":"      field.removeAttr(\"disabled\");"},{"line_number":189,"context_line":"    });"}],"source_content_type":"text/javascript","patch_set":1,"id":"9a1a9d01_39f494f0","line":186,"in_reply_to":"9a1a9d01_04838099","updated":"2015-09-28 17:52:58.000000000","message":"In this scope $(this) does indeed refer to the $form created before the enclosing anonymous function?","commit_id":"6cdef349ffaf9ac500637208a28d8fe413f87d00"},{"author":{"_account_id":8040,"name":"Timur Sufiev","email":"tsufiev@gmail.com","username":"tsufiev"},"change_message_id":"43c70525567660d71a183f084b9d78ffc44732dc","unresolved":false,"context_lines":[{"line_number":183,"context_line":"    }"},{"line_number":184,"context_line":"    // Remove disabled attribute on select fields before submit to get value"},{"line_number":185,"context_line":"    // included in POST request."},{"line_number":186,"context_line":"    $(this).find(\u0027select[disabled\u003d\"disabled\"]\u0027).each(function (i, field) {"},{"line_number":187,"context_line":"      var field \u003d $(field);"},{"line_number":188,"context_line":"      field.removeAttr(\"disabled\");"},{"line_number":189,"context_line":"    });"}],"source_content_type":"text/javascript","patch_set":1,"id":"9a1a9d01_acc5c43c","line":186,"in_reply_to":"9a1a9d01_39f494f0","updated":"2015-09-28 18:33:19.000000000","message":"Sorry, I just realized that was wrong - by mixing inner and outer scopes of submit handler function. Actually, $form may be a multiple form elements, and you\u0027re totally right in using $(this). \n\nJust a minor suggestion here then: you could store $(this) reference at the beginning of event handler into $this variable (near line 176). There was a refactoring some time ago that did the same thing (avoiding unnecessary calls to jquery constructors).","commit_id":"6cdef349ffaf9ac500637208a28d8fe413f87d00"}]}
