Skip to content

Commit

Permalink
Disable selectors until data is loaded
Browse files Browse the repository at this point in the history
Fixed an issue with selecting events by venue
  • Loading branch information
mbogoevici authored and pmuir committed May 28, 2012
1 parent d64e36c commit 1bdb8ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
8 changes: 6 additions & 2 deletions src/main/webapp/desktop-index.html
Expand Up @@ -228,6 +228,7 @@
$(this.el).empty()
applyTemplate($(this.el), $("#event-detail"), this.model.attributes)
$("#bookingOption").hide()
$("#venueSelector").attr('disabled', true)
$("#dayPicker").empty()
$("#dayPicker").attr('disabled', true)
$("#performanceTimes").empty()
Expand All @@ -239,6 +240,7 @@
$.each(shows, function (i, show) {
$("#venueSelector").append("<option value='" + show.id + "'>" + show.venue.address.city + " : " + show.venue.name + "</option>")
})
$("#venueSelector").removeAttr('disabled')
if ($("#venueSelector").val()) {
$("#venueSelector").change()
}
Expand Down Expand Up @@ -303,12 +305,13 @@
TicketMonster.VenueDetailView = Backbone.View.extend({
events:{
"click input[name='bookButton']":"beginBooking",
"change select[id='venueSelector']":"refreshShows",
"change select[id='eventSelector']":"refreshShows",
"change select[id='dayPicker']":"refreshTimes"
},
render:function () {
$(this.el).empty()
applyTemplate($(this.el), $("#venue-detail"), this.model.attributes)
$("#eventSelector").attr('disabled', true)
$("#bookingOption").hide()
$("#dayPicker").empty()
$("#dayPicker").attr('disabled', true)
Expand All @@ -321,6 +324,7 @@
$.each(shows, function (i, show) {
$("#eventSelector").append("<option value='" + show.id + "'>" + show.event.name + "</option>")
})
$("#eventSelector").removeAttr('disabled')
if ($("#eventSelector").val()) {
$("#eventSelector").change()
}
Expand Down Expand Up @@ -636,7 +640,7 @@
}
this.setCheckoutStatus()
},
setCheckoutStatus: function() {
setCheckoutStatus:function () {
if (this.model.bookingRequest.totals != undefined && this.model.bookingRequest.totals.tickets > 0 && this.model.bookingRequest.email != undefined && this.model.bookingRequest.email != '') {
$('input[name="submit"]').removeAttr('disabled')
}
Expand Down
16 changes: 6 additions & 10 deletions src/main/webapp/resources/templates/templates.html
Expand Up @@ -152,21 +152,17 @@ <h2 class="page-header"><%=name%></h2>
<img width="100" src='rest/media/<%=picture.id%>'/></div>
<div class="row-fluid">
<p>&nbsp;</p>

<div class="span12"><%= description %></div>
</div>
<div class="row-fluid">

</div>
</div>
<div class="span4 well">
<div class="row-fluid"><h3 class="page-header span6">What?</h3>

<div class="span6" id='eventMedia'/>
<div class="row-fluid">
<h3 class="page-header span6">What?</h3>
<div class="span6" id='eventMedia'></div>
</div>
<div class='row-fluid'><select id='eventSelector'/>

<div id="venueEventDescription"><div/>
<div class='row-fluid'>
<select id='eventSelector'/>
<div id="venueEventDescription"></div>
</div>
</div>
<div id='bookingWhen' style="display: none;" class="span2 well">
Expand Down

0 comments on commit 1bdb8ed

Please sign in to comment.