Skip to content

Instantly share code, notes, and snippets.

@jameswomack
Created April 27, 2013 05:08
Show Gist options
  • Save jameswomack/5471952 to your computer and use it in GitHub Desktop.
Save jameswomack/5471952 to your computer and use it in GitHub Desktop.
Add "1 year" to Github Pulse period drop-down menu
select_menu_list = $('.js-pulse-period').first()
yearly_item = select_menu_list.find('.js-navigation-item').last().clone()
select_menu_list.find('.select-menu-list').first().append(yearly_item)
yearly_item.removeClass('navigation-focus')
yearly_item.find('.js-select-button-text').text('1 year')
yearly_item_input = yearly_item.find('input').first()
yearly_item_data_url = yearly_item_input.attr('data-url')
yearly_item_input.attr('data-url', yearly_item_data_url.replace('monthly','yearly'))
yearly_item_id = yearly_item_input.attr('id')
yearly_item_input.attr('id', yearly_item_id.replace('monthly','yearly'))
yearly_item_input.attr('value','yearly')
@b-long
Copy link

b-long commented Nov 11, 2015

I love this, but it seems to no longer work 👍

@Lucas-C
Copy link

Lucas-C commented Sep 19, 2019

Indeed, $('.js-pulse-period') from the very first line returns null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment