haskell-infra / hl

Haskell web site (old -- see new repo at https://github.com/haskell-infra/www.haskell.org)
http://haskell.org/
BSD 3-Clause "New" or "Revised" License
158 stars 92 forks source link

Buttons "Click to expand" should change their values onclick #201

Closed epsxy closed 5 years ago

epsxy commented 7 years ago

This buttons on the homepage should display :

At the moment, it only display "Click to expand" in the 2 cases, even if the user want to collapse the block and that's a bit weird.

Maybe the feature can be added by adding 2 lines of code in hl/home.js, using ($this.value ?):

// Expandable features
function setupFeatures(){
  $('.features .span6').each(function(){
    var $this = $(this);
    $this.click(function(){
      $this.find('.expandable').slideToggle(function(){
        $this.value = "Click to collapse";
        $this.find('.expand').slideToggle('fast');
      });
    });
    if ($this.find('.expandable').size() == 0)
      $this.value = "Click to expand";
      $this.find('.expand').hide();
  });
}