What was wrong?
`initializeCommentDropdown` is called when a new comment is added.
`initializeCommentDropdown` calls `addDropdownListener(dropdown)` on all
`.dropbtn` elements. Elements with the `.dropbtn` class already exist on
the page so an extra listener is added to it whenever a comment is
added.
How was it fixed?
Whenever a dropdown listener is added to an element with the
`.dropbtn` class, an attribute is set on that element so we know it
already has a dropdown listener. When we add listeners to elements with
the `.dropbtn` class in the future, we don't add them to elements with
the attribute.
* Adds Clipboard Async API & makes use of Android Native Bridge interface for write post image copy to clipboard
* Checks for clipboard api support before trying to use it
* Adds support for comment dropdown copy link
* Adds AndroidBridge to globals definition
* Fix JavaScript Console errors in /Comments sub-page of any article
- Make use of `document.body.contains()` to check if the element is present before trying to Add or Remove Event listeners or assign attribute values to the same.
* Implement recommendations for changes
- Switch String.match() to Regex.test() in order to have consistent Boolean return.
- Switch if(document.body.contains(element)) to if(element) as no need to check if the element is in visible context, only whether present or not.
* Implement recommendations for changes
- Switch String.match() to Regex.test() in order to have consistent Boolean return for isIOSDevice().
- Switch if(document.body.contains(element)) to if(element) as no need to check if the element is in visible context, only whether present or not.
* Simplify article show page reactions
* Clean up styling and adjust zen mode logic
* Remove unused variables
* Update app/views/articles/_actions.html.erb
Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>
* Small style mods
* Slight padding change
* Finalize new show page button design
* Remove uncompileable JS and small css changes
* Simplify article show page reactions
* Clean up styling and adjust zen mode logic
* Remove unused variables
* Update app/views/articles/_actions.html.erb
Co-Authored-By: Nick Taylor <nick@iamdeveloper.com>
* Small style mods
* Slight padding change
* Finalize new show page button design