From 523d340adecf12bb5ba438c4873170923a71d37e Mon Sep 17 00:00:00 2001
From: chylex <info@chylex.com>
Date: Fri, 30 Sep 2016 15:09:52 +0200
Subject: [PATCH] Remove the disabled() event handler in timeline-polls plugin

---
 Resources/Plugins/timeline-polls/browser.js | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/Resources/Plugins/timeline-polls/browser.js b/Resources/Plugins/timeline-polls/browser.js
index 369c7500..c12e41d8 100644
--- a/Resources/Plugins/timeline-polls/browser.js
+++ b/Resources/Plugins/timeline-polls/browser.js
@@ -6,15 +6,11 @@ constructor(){
 
 enabled(){
   // add a stylesheet
-  this.css = window.TDPF_createCustomStyle(this);
-  this.css.insert(".column-detail .timeline-poll-container { display: none }");
+  window.TDPF_createCustomStyle(this).insert(".column-detail .timeline-poll-container { display: none }");
   
   // setup layout injecting
-  this.prevMustaches = {};
-  
   var injectLayout = (mustache, onlyIfNotFound, search, replace) => {
     if (TD.mustaches[mustache].indexOf(onlyIfNotFound) === -1){
-      this.prevMustaches[mustache] = TD.mustaches[mustache];
       TD.mustaches[mustache] = TD.mustaches[mustache].replace(search, replace);
     }
   };
@@ -25,6 +21,5 @@ enabled(){
 }
 
 disabled(){
-  this.css.remove();
-  Object.keys(this.prevMustaches).forEach(mustache => TD.mustaches[mustache] = this.prevMustaches[mustache]);
+  // not needed, plugin reloads the page when enabled or disabled
 }
\ No newline at end of file