From a368f19b08e8b070a1ecbfd9be154af6317bc45e Mon Sep 17 00:00:00 2001 From: peiying16 Date: Fri, 10 Feb 2017 08:11:15 -0500 Subject: [PATCH 1/2] Init Allow JavaScript --- public/editor/scripts/editor/js/fc/bramble-menus.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/public/editor/scripts/editor/js/fc/bramble-menus.js b/public/editor/scripts/editor/js/fc/bramble-menus.js index ae6d4a4d0..4cd7878d5 100644 --- a/public/editor/scripts/editor/js/fc/bramble-menus.js +++ b/public/editor/scripts/editor/js/fc/bramble-menus.js @@ -55,6 +55,16 @@ define(function(require) { // Set initial UI value to match editor value setWordWrapUI(bramble.getWordWrap()); + + + //set allow javascript UI + if(bramble.getAllowJavaScript()) { + $("#allow-scripts-toggle").addClass("switch-enabled"); + } else { + $("#allow-scripts-toggle").removeClass("switch-enabled"); + } + + // Enable/Disable JavaScript in Preview $("#allow-scripts-toggle").click(function() { From af0da5eeeb727d37462a75e6e38ad3f3b57baeac Mon Sep 17 00:00:00 2001 From: peiying16 Date: Fri, 10 Feb 2017 08:14:24 -0500 Subject: [PATCH 2/2] Change comment --- public/editor/scripts/editor/js/fc/bramble-menus.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/public/editor/scripts/editor/js/fc/bramble-menus.js b/public/editor/scripts/editor/js/fc/bramble-menus.js index 4cd7878d5..45c52baab 100644 --- a/public/editor/scripts/editor/js/fc/bramble-menus.js +++ b/public/editor/scripts/editor/js/fc/bramble-menus.js @@ -54,18 +54,12 @@ define(function(require) { }); // Set initial UI value to match editor value setWordWrapUI(bramble.getWordWrap()); - - - - //set allow javascript UI + //set initial UI value to allow javascript UI if(bramble.getAllowJavaScript()) { $("#allow-scripts-toggle").addClass("switch-enabled"); } else { $("#allow-scripts-toggle").removeClass("switch-enabled"); } - - - // Enable/Disable JavaScript in Preview $("#allow-scripts-toggle").click(function() { // Toggle current value