[wp-trac] [WordPress Trac] #24695: Disabling the Save and Publish buttons when heartbeat connection is in error state

WordPress Trac noreply at wordpress.org
Thu Jul 18 16:49:41 UTC 2013


#24695: Disabling the Save and Publish buttons when heartbeat connection is in
error state
------------------------------------------+-------------------------
 Reporter:  azaozz                        |       Owner:  carldanley
     Type:  defect (bug)                  |      Status:  reviewing
 Priority:  normal                        |   Milestone:  3.6
Component:  Administration                |     Version:  trunk
 Severity:  normal                        |  Resolution:
 Keywords:  has-patch commit 2nd-opinion  |
------------------------------------------+-------------------------

Comment (by carldanley):

 Makes total sense. Also, I can see that this is really adding a function
 signature for a single line of code BUT it's important going forward. This
 anonymous function will probably end up getting patched in early 3.7 to
 remove anonymity AND allow for a clear indication of what's going on. It
 removes the extremely long "inline" function calls and makes code easier
 to read. For this patch, I kept it simple to do what you wanted going
 forward. My patch for the heartbeat API
 (http://core.trac.wordpress.org/attachment/ticket/23216/23216-heartbeat-
 cleanup.5.diff [most recent iteration as of the time I'm posting this
 comment]) fixes all of these anonymous functions by moving them to proper
 private declarative functions. Just my two cents though, I'm ok with going
 whatever flow you think is necessary for this patch. If you think it's a
 good idea, I can open a new ticket to discuss this practice of code
 styling in JS.

 Also, a lesser point, can you imagine trying to add documentation for this
 anonymous function when it's inline like that?

 I can take point on supplying a new patch with the fixes for the other
 deferred's in that XHR if you need, just give me the word.

--
Ticket URL: <http://core.trac.wordpress.org/ticket/24695#comment:16>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list