New submission from Liang Bo Wang:

The code output toggle button (the `>>>` button on the top right) has been 
disappeared and not functional on the current online documentation (both 3.4+ 
and 2.7). 


For example, see any doc page that has interpreter outputs:

    https://docs.python.org/3/tutorial/introduction.html#numbers
    https://docs.python.org/3.5/tutorial/introduction.html#numbers
    https://docs.python.org/3.4/tutorial/introduction.html#numbers
    https://docs.python.org/2/tutorial/introduction.html#numbers


These toggle buttons are created dynamically using jQuery by the script at 
Doc/tools/static/copybutton.js. However, the method .toggle() it used for click 
event handling has been deprecated since jQuery 1.8 and removed since jQuery 
1.9.

    https://api.jquery.com/toggle-event/


Current Python documentation ships with jQuery v1.11.1 and it has a new 
.toggle() method with totally different behavior, which controls animation and 
hide the element. Therefore those buttons are invisible and has no effect.

    https://api.jquery.com/toggle/


To achieve the old behavior, one now needs to create this toggle event on one's 
own. The most popular way to store the toggle state is by jQuery's .data() data 
storage.

A patch is attached to make the button functional again.

----------
assignee: docs@python
components: Documentation
files: copybutton_js.patch
keywords: patch
messages: 259279
nosy: Liang Bo Wang, docs@python, eric.araujo, ezio.melotti, georg.brandl
priority: normal
severity: normal
status: open
title: Code output toggle button uses removed jQuery method
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file41764/copybutton_js.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26246>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to