7c22af6b5752b0ea89f88f7de95b774e294c09f6
[unfold.git] / engine / static / js / plugin.js
1 /* upon document completion, we locate all the hide and show areas, 
2  * and configure their behaviour 
3  */
4 $(document).ready(function() {
5     window.console.log("Setting plugin toggle behaviour");
6     $('.plugin-hide').each(function() {
7         window.console.log("Setting plugin toggle behaviour on hide "+$(this).attr('id'));
8         $(this).click(function () { 
9             window.console.log("click on a HIDE button");
10             var plugin='#'+$(this).attr('id').replace('hide-',''); 
11             var show='#'+$(this).attr('id').replace('hide-','show-'); 
12             jQuery(plugin).hide(); jQuery(show).show(); $(this).hide();});
13         })
14     $('.plugin-show').each(function() {
15         window.console.log("Setting plugin toggle behaviour on show "+$(this).attr('id'));
16         $(this).click(function () { 
17             window.console.log("click on a SHOW button");
18             var plugin='#'+$(this).attr('id').replace('show-',''); 
19             var hide='#'+$(this).attr('id').replace('show-','hide-'); 
20             jQuery(plugin).show(); jQuery(hide).show(); $(this).hide();});
21         })
22     })