adding button data tags and testing the click functionality for the export buttons
authorAnthony Talarico <talarico@gaslightmedia.com>
Thu, 27 Sep 2018 20:53:59 +0000 (16:53 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Thu, 27 Sep 2018 20:53:59 +0000 (16:53 -0400)
views/admin/newDashboard/components/buttons.html
views/admin/newDashboard/index.html

index 71cae76..9fe464c 100644 (file)
@@ -2,11 +2,10 @@
     <div class="s12 col">
         {foreach $component.buttons as $buttonName => $buttonData}
             <a class="btn btn-small waves-effect waves-light {$buttonName}-button {if $buttonData.classes}{$buttonData.classes}{/if}" 
-             style="font-style: normal; position: absolute; right: 8px; top: 10px;{if $buttonData.styles}{$buttonData.styles}{/if}" 
-             href="{if $buttonData.url}{$buttonData.url}{else}#{/if}">
+             style="font-style: normal; {if $buttonData.styles}{$buttonData.styles}{/if}" 
+             href="{if $buttonData.url}{$buttonData.url}{else}#{/if}"  {if $buttonData.data} data-export={$buttonData.data} {/if}>
                {if $buttonData.content}{$buttonData.content}{/if}
             </a>
         {/foreach}
-        
     </div>
 </div>
\ No newline at end of file
index d7fd6eb..c3598f4 100644 (file)
@@ -13,6 +13,9 @@
 <script> 
     jQuery(function($){
         M.AutoInit();
+        $(".widget-export-btn").on("click", function(){
+            console.log( $(this).data('export') );
+        })
     })
 </script>