keep it simple
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 25 Mar 2013 08:07:58 +0000 (09:07 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Mon, 25 Mar 2013 08:07:58 +0000 (09:07 +0100)
unfold/js/plugin.js

index b03b737..5aa90fa 100644 (file)
@@ -22,14 +22,14 @@ var plugin = {
     init_all_plugins: function() {
        $('.plugin-hide').each(function() {
            $(this).click(function () { 
-               var plugin='#'+$(this).attr('id').replace('hide-',''); 
-               var show='#'+$(this).attr('id').replace('hide-','show-'); 
+               var plugin='#'+this.id.replace('hide-',''); 
+               var show='#'+this.id.replace('hide-','show-'); 
                $(plugin).slideUp(); $(show).show(); $(this).hide();});
        });
        $('.plugin-show').each(function() {
            $(this).click(function () { 
-               var plugin='#'+$(this).attr('id').replace('show-',''); 
-               var hide='#'+$(this).attr('id').replace('show-','hide-'); 
+               var plugin='#'+this.id.replace('show-',''); 
+               var hide='#'+this.id.replace('show-','hide-'); 
                $(plugin).slideDown(); $(hide).show(); $(this).hide();});
        });
        $('.plugin-tooltip').each(function(){ $(this).tooltip({'selector':'','placement':'right'}); });