[Koha-bugs] [Bug 16238] Upgrade jQuery : use .prop() instead of .attr() for 'checked'

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 13 14:38:35 CEST 2016


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16238

Marc Véron <veron at veron.ch> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #50119|0                           |1
        is obsolete|                            |

--- Comment #4 from Marc Véron <veron at veron.ch> ---
Created attachment 50193
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=50193&action=edit
Bug 16238: Use .prop() instead of .attr() for 'checked'

According to https://jquery.com/upgrade-guide/1.9/#attr-versus-prop-
.attr() is no longer correct to access the checked state of a checkbox.

This patch do the following replacements:
  .attr('checked')               =>  .prop('checked')
  .attr('checked, '')            =>  .prop('checked', false)
  .attr('checked, 'checked')     =>  .prop('checked', true)
  .attr('checked', boolValue)    =>  .prop('checked', boolValue)
  .removeAttr('checked')         =>  .prop('checked', false)
  .attr('checked') == 'checked'  =>  .is(':checked')

Signed-off-by: Marc Véron <veron at veron.ch>

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list