Skip to content

Commit 33ef0ae

Browse files
Add Modal Fixer
1 parent de2f7e0 commit 33ef0ae

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Snippet Modal Fixer ( [install](https://github.com/CertainPerformance/Stack-Exchange-Userscripts/raw/master/Stack-Snippet-Userscripts/Modal-Fixer/StackSnippetModalFixer.user.js) )
2+
3+
When opening a snippet, if you click too quickly before the snippet modal has been populated, SE's JS will throw an error due to a bug, preventing you from exiting the snippet and returning to the post. See [here](https://meta.stackoverflow.com/q/372944) for details. This userscript fixes the bug.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// ==UserScript==
2+
// @name Stack Snippet Modal Fixer
3+
// @description Prevents snippet double-clicking from breaking the snippet interface
4+
// @description https://meta.stackoverflow.com/q/372944
5+
// @author CertainPerformance
6+
// @namespace https://github.com/CertainPerformance/Stack-Exchange-Userscripts
7+
// @version 1.0.0
8+
// @include /^https://(?:(?:(?:codereview|gamedev|codegolf|meta)\.(?:meta\.)?stackexchange\.com)|(\w+\.)?(?:meta\.)?stackoverflow\.com)/(?:questions/|posts/\d+/edit|review/\w(?!.*/stats|.*/history))/
9+
// @grant none
10+
// ==/UserScript==
11+
12+
'use strict';
13+
14+
document.body.appendChild(document.createElement('style')).textContent = `
15+
.snippet-modal {
16+
pointer-events: auto !important;
17+
}
18+
`;

Stack-Snippet-Userscripts/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ Stack Exchange Userscripts for Stack Snippets (which are [active on](https://met
66

77
- [Find](https://github.com/CertainPerformance/Stack-Exchange-Userscripts/tree/master/Stack-Snippet-Userscripts/Find) - Makes control-F inside snippet editor only show results inside the editor
88
- [Lag Fixer](https://github.com/CertainPerformance/Stack-Exchange-Userscripts/tree/master/Stack-Snippet-Userscripts/Lag-Fixer) - Makes post previews with stack snippets re-render after a debounced delay, rather than immediately after every keypress
9+
- [Modal Fixer](https://github.com/CertainPerformance/Stack-Exchange-Userscripts/tree/master/Stack-Snippet-Userscripts/Modal-Fixer) - Fixes [a bug]((https://meta.stackoverflow.com/q/372944) that makes it impossible to exit the snippet interface
910
- [Render All Lines](https://github.com/CertainPerformance/Stack-Exchange-Userscripts/tree/master/Stack-Snippet-Userscripts/Render-All-Lines) - Renders all code lines, so that code anywhere in the snippet can be searched for with Control-F
1011
- [Visible Cursor](https://github.com/CertainPerformance/Stack-Exchange-Userscripts/tree/master/Stack-Snippet-Userscripts/Visible-Cursor) - Makes the CodeMirror text cursor always visible even when the browser is zoomed out

0 commit comments

Comments
 (0)