From 402a246174b1fa16f2f35540c8cb10459bd492fd Mon Sep 17 00:00:00 2001 From: 8chan Date: Tue, 21 Apr 2015 07:11:33 -0700 Subject: [PATCH] Suppress (maybe harmless) error on no postcontrols selector (happens on catalog) --- templates/main.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/templates/main.js b/templates/main.js index 836eda31..90cdbb22 100644 --- a/templates/main.js +++ b/templates/main.js @@ -318,9 +318,11 @@ var script_settings = function(script_name) { function init() { // store highlighted text for citeReply() - document.querySelector('form[name="postcontrols"]').addEventListener('mouseup', function (e) { - sessionStorage.quoteClipboard = window.getSelection().toString(); - }); + if (document.querySelector('form[name="postcontrols"]') !== null) { + document.querySelector('form[name="postcontrols"]').addEventListener('mouseup', function (e) { + sessionStorage.quoteClipboard = window.getSelection().toString(); + }); + } // just enable jquery, almost every script requires it by now. more and more main.js functions are going to start requiring it $('.post-table-options').css('display', 'none');