)]}'
{"horizon/static/framework/widgets/action-list/actions.controller.js":[{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"4bd6ae8cc833d713b8e2f889c94229690b97b3e8","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"da0c15f0_5868f4ba","updated":"2016-03-24 20:14:23.000000000","message":"This approach reminds me a bit of how we use jquery in legacy. If you do this in a few places, it starts looking like spaghetti. When something goes wrong, it is hard to track down the problem.\n\nI think the directive should be responsible for enabling/disable itself. It should listen to certain events that the action button trigger. In this case, action and checkboxes should register itself to an event, and when the action is taken, the directive will do something. This design is more debuggable since the code related to it are all in one place (as oppose to a global override hidden somewhere).","commit_id":"5a4b8624ca055dbae78cdb00608d28af764042f1"},{"author":{"_account_id":9647,"name":"Justin Pomeroy","email":"jpomero@linux.vnet.ibm.com","username":"jpomero"},"change_message_id":"a191cc65346e0e72434b8d9ef2199f73928a52e2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"da0c15f0_784c8a42","in_reply_to":"da0c15f0_5868f4ba","updated":"2016-03-28 01:30:01.000000000","message":"In general I agree this approach is kind of like killing a fly with a shotgun, and I don\u0027t really like it that much.  The real fix I think is to make sure actions do not perform any kind of async operation before showing something to the user.  That way the button really can\u0027t be clicked more than once, or at least the user is going to know something is happening and not click it again thinking it didn\u0027t work.","commit_id":"5a4b8624ca055dbae78cdb00608d28af764042f1"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"4bd6ae8cc833d713b8e2f889c94229690b97b3e8","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    function preAction() {"},{"line_number":106,"context_line":"      // Temporarily disable elements while the action is being performed"},{"line_number":107,"context_line":"      var elements \u003d angular.element($window.document.body).find(disableElements.join(\u0027,\u0027));"},{"line_number":108,"context_line":"      angular.forEach(elements, function disableElement(elm) {"},{"line_number":109,"context_line":"        elm \u003d angular.element(elm);"},{"line_number":110,"context_line":"        if (!elm.hasClass(\u0027disabled\u0027)) {"}],"source_content_type":"text/javascript","patch_set":2,"id":"da0c15f0_82e21b9e","line":107,"updated":"2016-03-24 20:14:23.000000000","message":"why not use $document.body instead?","commit_id":"5a4b8624ca055dbae78cdb00608d28af764042f1"},{"author":{"_account_id":9647,"name":"Justin Pomeroy","email":"jpomero@linux.vnet.ibm.com","username":"jpomero"},"change_message_id":"a191cc65346e0e72434b8d9ef2199f73928a52e2","unresolved":false,"context_lines":[{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    function preAction() {"},{"line_number":106,"context_line":"      // Temporarily disable elements while the action is being performed"},{"line_number":107,"context_line":"      var elements \u003d angular.element($window.document.body).find(disableElements.join(\u0027,\u0027));"},{"line_number":108,"context_line":"      angular.forEach(elements, function disableElement(elm) {"},{"line_number":109,"context_line":"        elm \u003d angular.element(elm);"},{"line_number":110,"context_line":"        if (!elm.hasClass(\u0027disabled\u0027)) {"}],"source_content_type":"text/javascript","patch_set":2,"id":"da0c15f0_38421211","line":107,"in_reply_to":"da0c15f0_82e21b9e","updated":"2016-03-28 01:30:01.000000000","message":"yep, makes sense.","commit_id":"5a4b8624ca055dbae78cdb00608d28af764042f1"},{"author":{"_account_id":9576,"name":"Thai Tran","email":"tqtran@us.ibm.com","username":"tqtran"},"change_message_id":"4bd6ae8cc833d713b8e2f889c94229690b97b3e8","unresolved":false,"context_lines":[{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    function postAction() {"},{"line_number":119,"context_line":"      // Re-enable all temporarily disabled elements after the action is complete"},{"line_number":120,"context_line":"      var elements \u003d angular.element($window.document.body).find(disableElements.join(\u0027,\u0027));"},{"line_number":121,"context_line":"      angular.forEach(elements, function enableElement(elm) {"},{"line_number":122,"context_line":"        elm \u003d angular.element(elm);"},{"line_number":123,"context_line":"        if (elm.hasClass(\u0027disabled\u0027) \u0026\u0026 elm.data(\u0027temp-disabled\u0027) \u003d\u003d\u003d \u0027true\u0027) {"}],"source_content_type":"text/javascript","patch_set":2,"id":"da0c15f0_85bb450e","line":120,"updated":"2016-03-24 20:14:23.000000000","message":"only a single action can be taken at a time. essentially, elements found in preAction are the same elements found in postAction. ideally, should perform find once, and reuse it again in postAction. You can either pass reference or move preAction and postAction into genPassThroughCallback for closure.","commit_id":"5a4b8624ca055dbae78cdb00608d28af764042f1"}]}
