EmptyMind Posted July 16, 2013 Report Posted July 16, 2013 Hey Guys, quick question. For module 'manage' tabs, we are running into 2 issues hopefully you can point us in the right direction. 1) CSS, Since the tab switching is done via an ajax 'replacer' call, there is no way to 'inject' the css into the header of the page in the tab function. Where would be the 'right place' to load up the css for the module? (Doing it all inline really sucks). 2) AJAX.. is there a place or method of calling that we can use to properly call ajax, so that our functions can still access 'blesta' but so that blesta will just allow the code to run, and output the json back to the javascript without messing about with it. Kinda like the 'tab switching'. James
Tyson Posted July 16, 2013 Report Posted July 16, 2013 Here's an example of each: <script type="text/javascript"> $(document).ready(function() { // Load CSS (taken from SolusVM module) $(this).blestaSetHeadTag("link", {media:"screen", type:"text/css", rel:"stylesheet", href: "<?php echo $this->Html->safe($this->view_dir . "css/styles.css");?>"}); // AJAX request (taken from admin_packages_add template $(document).blestaRequest('POST', '<?php echo $this->Html->safe($this->base_uri . "packages/moduleoptions/");?>', $('#module_id').closest('form').serialize() + meta_values, function(data) { if (data) { $('#module_options').html(''); $('#module_email_tags').html(''); $('#module_options').html(data.module_options); $('#module_email_tags').html(data.module_email_tags); } }, null, {dataType:'json'} ); }); </script>
EmptyMind Posted July 16, 2013 Author Report Posted July 16, 2013 Thanks as always Tyson, we'll give those a shot.
Tyson Posted July 16, 2013 Report Posted July 16, 2013 Just a note that loading CSS from javascript doesn't work in some versions of Internet Explorer.
Scott Horsley Posted July 16, 2013 Report Posted July 16, 2013 On 7/16/2013 at 7:49 PM, Tyson said: Just a note that loading CSS from javascript doesn't work in some versions of Internet Explorer. Surprise surprise
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now