Created
November 9, 2011 21:03
-
-
Save codeschool-courses/1353020 to your computer and use it in GitHub Desktop.
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 setSeat(e, handler) { | |
e.preventDefault(); | |
$('.selected').removeClass('selected').click(handler); | |
$(e.target).addClass('selected').unbind('click', handler); | |
$('#seatSelected').text($(e.target).data('seat')); | |
} | |
function selectFirstClass(e) { | |
setSeat(e, selectFirstClass); | |
var resulting_html = fetchFirstClassConfirm(); | |
$('#confirm-first-class').html(resulting_html); | |
$('#confirm-first-class').show(); | |
} | |
function selectSeat(e) { | |
setSeat(e, selectSeat); | |
$('#confirm-seat').show(); | |
$('#confirm-first-class').hide(); | |
} | |
function fetchFirstClassConfirm() { | |
// AJAX is called here, but we haven't learned that yet | |
// This returns the a.confirm-upgrade link (trust me) | |
} | |
function confirmUpgrade(e) { | |
e.preventDefault(); | |
$('#confirm-first-class').hide(); | |
$('#confirm-seat').show(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment