adding reset function when shortcode is reset or the page is reset
authorAnthony Talarico <talarico@gaslightmedia.com>
Mon, 11 Feb 2019 20:18:17 +0000 (15:18 -0500)
committerAnthony Talarico <talarico@gaslightmedia.com>
Mon, 11 Feb 2019 20:18:17 +0000 (15:18 -0500)
js/shortcodeBuilder.js

index 6aac3a7..5bc25c3 100644 (file)
@@ -1,9 +1,3 @@
-/**
- * Other needed Admin JS code
- * Block level comments used temporarily to make finding sections of the code easier
- * a lot of duplicate code and unnecessary variables I need to clean up, need to change case from camel case to snake case
- * need to create a function for setting the editor content because it is duplicated a few times
- */
 jQuery(function ($) {
     var shortcode_string = $("<div >", {
         text: '[glm-members-list',
@@ -43,6 +37,7 @@ jQuery(function ($) {
         tile.appendTo(elHook);
     }
     function setupAttributes(state){
+        $(".shortcode-selection").each(function() { this.selectedIndex = 0 });
         $("#shortcode-preview").empty();
         $(".shortcode-tile-container").empty();
         shortcodeAttributes = {