Summary: | Eliminate use of deprecated jQuery .toggle() method usage | ||
---|---|---|---|
Product: | Koha | Reporter: | Owen Leonard <oleonard> |
Component: | Templates | Assignee: | Owen Leonard <oleonard> |
Status: | CLOSED FIXED | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | fridolin.somers, gmcharlt, matted-34813, veron |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage
[SIGNED-OFF] Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage [Signed-off] Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage [PASSED QA] Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage |
Description
Owen Leonard
2014-02-28 20:25:48 UTC
Created attachment 25824 [details] [review] Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage jQuery's .toggle() method can no longer be used to trigger a pair of specified functions. .toggle() can only be used to change the visibility of an element. This patch fixes a few places in Koha where the deprecated functionality was used. To test, apply the patch and clear your browser cache. - View the system preferences page in the staff client. Clicking a heading ("Appearance" under OPAC preferences, for instance) should collapse that section. Clicking again should expand it. - View the MARC detail page for a record in the OPAC. Clicking the "view plain" link should display the plain MARC view. Clicking the "view labeled" view should return to the original view. Test in both prog and bootstrap themes. Created attachment 25831 [details] [review] [SIGNED-OFF] Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage Performed test plan. Worked fine. Did a qucik search to see if other .toggle usage was present, and got these results, so if they don't need to be addressed, we could change the status to signed off, otherwise things will wait for further followup patches. It may depend on the jquery update only needing to be done for OPAC. 12:45:28 {bug11878 %} ~/prj/kohaclone$ find . -name "*.js" -exec grep -Hn ".toggle()" {} \; Some places where toggle is in our source tree after the 1st patch applied: ./koha-tmpl/opac-tmpl/bootstrap/lib/bootstrap/js/bootstrap.js:1814: this.options.toggle && this.toggle() ./koha-tmpl/opac-tmpl/bootstrap/js/script.js:54: $(".menu-collapse").toggle(); ./koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js:15: $("#itemst td:nth-child("+valCookie[i]+"),#itemst th:nth-child("+valCookie[i]+")").toggle(); ./koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js:29: $("#itemst td:nth-child("+hide+"),#itemst th:nth-child("+hide+")").toggle(); ./koha-tmpl/intranet-tmpl/prog/en/js/pages/batchMod.js:65: $("#itemst td:nth-child("+show+"),#itemst th:nth-child("+show+")").toggle(); ./koha-tmpl/intranet-tmpl/prog/en/js/acq.js:863: $("#plan td:nth-child("+hide+"),#plan th:nth-child("+hide+")").toggle(); ./koha-tmpl/intranet-tmpl/prog/en/js/acq.js:872: $("#plan td:nth-child("+show+"),#plan th:nth-child("+show+")").toggle(); (In reply to wajasu from comment #3) > Did a qucik search to see if other .toggle usage was present, and got these > results, so if they don't need to be addressed, we could change the status ... > ./koha-tmpl/intranet-tmpl/prog/en/js/acq.js:872: $("#plan > td:nth-child("+show+"),#plan th:nth-child("+show+")").toggle(); No, these do not need to be addressed: '.toggle(function, function, ... ) removed: This is the "click an element to run the specified functions" signature of .toggle(). It should not be confused with the "change the visibility of an element" of .toggle() which is not deprecated.' My patch fixes all the instances which I know to be problematic. Created attachment 25841 [details] [review] [Signed-off] Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage jQuery's .toggle() method can no longer be used to trigger a pair of specified functions. .toggle() can only be used to change the visibility of an element. This patch fixes a few places in Koha where the deprecated functionality was used. To test, apply the patch and clear your browser cache. - View the system preferences page in the staff client. Clicking a heading ("Appearance" under OPAC preferences, for instance) should collapse that section. Clicking again should expand it. - View the MARC detail page for a record in the OPAC. Clicking the "view plain" link should display the plain MARC view. Clicking the "view labeled" view should return to the original view. Test in both prog and bootstrap themes. Signed-off-by: wajasu <matted-34813@mypacks.net> Followed test plan. Works fine. Signed-off-by: Marc Véron <veron@veron.ch> Created attachment 26378 [details] [review] [PASSED QA] Bug 11878 - Eliminate use of deprecated jQuery .toggle() method usage jQuery's .toggle() method can no longer be used to trigger a pair of specified functions. .toggle() can only be used to change the visibility of an element. This patch fixes a few places in Koha where the deprecated functionality was used. To test, apply the patch and clear your browser cache. - View the system preferences page in the staff client. Clicking a heading ("Appearance" under OPAC preferences, for instance) should collapse that section. Clicking again should expand it. - View the MARC detail page for a record in the OPAC. Clicking the "view plain" link should display the plain MARC view. Clicking the "view labeled" view should return to the original view. Test in both prog and bootstrap themes. Signed-off-by: wajasu <matted-34813@mypacks.net> Followed test plan. Works fine. Signed-off-by: Marc Véron <veron@veron.ch> Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de> Passes all tests and QA script, works as described. No Javascript errors found. Pushed to master. Thanks, Owen! Pushed to 3.14.x, will be in 3.14.08 |