Created
April 27, 2013 05:08
-
-
Save jameswomack/5471952 to your computer and use it in GitHub Desktop.
Add "1 year" to Github Pulse period drop-down menu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
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
I love this, but it seems to no longer work 👍