浏览代码

BUGFIX: Fixed seasonal event handling.

n1474335 8 年之前
父节点
当前提交
e2e68dd876

文件差异内容过多而无法显示
+ 0 - 0
build/prod/cyberchef.htm


文件差异内容过多而无法显示
+ 0 - 0
build/prod/index.html


文件差异内容过多而无法显示
+ 0 - 0
build/prod/scripts.js


+ 2 - 2
src/js/views/html/Manager.js

@@ -136,8 +136,8 @@ Manager.prototype.initialise_event_listeners = function() {
     // Options
     document.getElementById("options").addEventListener("click", this.options.options_click.bind(this.options));
     document.getElementById("reset-options").addEventListener("click", this.options.reset_options_click.bind(this.options));
-    $(".option-item input:checkbox").on("switchChange.bootstrapSwitch", this.options.switch_change.bind(this.options));
-    $(".option-item input:checkbox").on("switchChange.bootstrapSwitch", this.options.set_word_wrap.bind(this.options));
+    $(document).on("switchChange.bootstrapSwitch", ".option-item input:checkbox", this.options.switch_change.bind(this.options));
+    $(document).on("switchChange.bootstrapSwitch", ".option-item input:checkbox", this.options.set_word_wrap.bind(this.options));
     this.add_dynamic_listener(".option-item input[type=number]", "keyup", this.options.number_change, this.options);
     this.add_dynamic_listener(".option-item input[type=number]", "change", this.options.number_change, this.options);
     this.add_dynamic_listener(".option-item select", "change", this.options.select_change, this.options);

+ 3 - 2
src/js/views/html/SeasonalWaiter.js

@@ -25,8 +25,8 @@ SeasonalWaiter.prototype.load = function() {
     if (now.getMonth() == 11 && now.getDate() > 12) { // Dec 13 -> Dec 31
         this.app.options.snow = false;
         this.create_snow_option();
-        this.manager.add_dynamic_listener(".option-item input:checkbox[option='snow']", "switchChange.bootstrapSwitch", this.let_it_snow, this);
-        this.manager.add_window_listener("resize", this.let_it_snow, this);
+        $(document).on("switchChange.bootstrapSwitch", ".option-item input:checkbox[option='snow']", this.let_it_snow.bind(this));
+        window.addEventListener("resize", this.let_it_snow.bind(this));
         this.manager.add_listeners(".btn", "click", this.shake_off_snow, this);
         if (now.getDate() == 25) this.let_it_snow();
     }
@@ -158,6 +158,7 @@ SeasonalWaiter.prototype.let_it_snow = function() {
     $(document).snowfall(options);
 };
 
+
 /**
  * When a button is clicked, shake the snow off that button.
  * #letitsnow

+ 4 - 4
src/static/stats.txt

@@ -1,9 +1,9 @@
 203	source files
-104409	lines
+104410	lines
 4.0M	size
 
 136	JavaScript source files
-95313	lines
+95314	lines
 3.5M	size
 
 78	third party JavaScript source files
@@ -11,11 +11,11 @@
 2.7M	size
 
 58	first party JavaScript source files
-18936	lines
+18937	lines
 728K	size
 
 3.2M	uncompressed JavaScript size
-1.7M	compressed JavaScript size
+	compressed JavaScript size
 
 15	categories
 155	operations

部分文件因为文件数量过多而无法显示