Last active
June 12, 2018 17:35
-
-
Save nataliastanko/2a1051d79ae97e0dd97467dbd5e8ebeb to your computer and use it in GitHub Desktop.
Delete first free order on Eventbrite -> Event -> Manage Attendees -> Orders page
This file contains 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
(function() { | |
'use strict'; | |
if (document.getElementsByClassName('js-d-select-box').length === 0) { | |
throw new Error("No more orders! App stoped arbitrarily."); | |
} | |
Array.from(document.getElementsByClassName('js-d-select-box')).forEach( | |
function(currentSelect, index, arr) { | |
if (currentSelect.getAttribute('data-automation') == 'order-actions-select') { | |
Array.from(currentSelect.children).forEach( | |
function(currentOption, index, arr) { | |
if (currentOption.getAttribute('data-automation') == 'order-delete') { | |
currentSelect.selectedIndex = index; | |
currentOption.selected = true; | |
currentSelect.onchange(); | |
} | |
} | |
); | |
} | |
} | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment