Skip to content

Commit

Permalink
Fix bug with lower third ordering getting messed up if edited by mult…
Browse files Browse the repository at this point in the history
…iple users without refreshing.
  • Loading branch information
patfair committed Oct 4, 2023
1 parent d472797 commit cc4ceb1
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion static/js/lower_thirds.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var reorderLowerThird = function(button, moveUp) {
// Gathers the lower third info and constructs a JSON object.
var constructLowerThird = function(button) {
return { Id: parseInt(button.form.id.value), TopText: button.form.topText.value,
BottomText: button.form.bottomText.value, DisplayOrder: parseInt(button.form.displayOrder.value) }
BottomText: button.form.bottomText.value }
};

$(function() {
Expand Down
2 changes: 0 additions & 2 deletions templates/setup_lower_thirds.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
placeholder="Top Text"/>
<input type="text" class="form-control" name="bottomText" value="{{$lowerThird.BottomText}}"
placeholder="Bottom Text"/>
<input type="hidden" name="displayOrder" value="{{$i}}" />
</div>
<div class="col-lg-6">
<button type="button" class="btn btn-info btn-lower-third" onclick="saveLowerThird(this);">
Expand Down Expand Up @@ -51,7 +50,6 @@
<input type="hidden" name="id" value="0" />
<input type="text" class="form-control" name="topText" placeholder="Top or Solo Text" />
<input type="text" class="form-control" name="bottomText" placeholder="Bottom Text" />
<input type="hidden" name="displayOrder" value="{{len .LowerThirds}}" />
</div>
<div class="col-lg-6">
<button type="button" class="btn btn-info btn-lower-third" name="save" onclick="saveLowerThird(this);">
Expand Down
1 change: 1 addition & 0 deletions web/setup_lower_thirds.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ func (web *Web) saveLowerThird(lowerThird *model.LowerThird) error {
lowerThird.DisplayOrder = web.arena.Database.GetNextLowerThirdDisplayOrder()
err = web.arena.Database.CreateLowerThird(lowerThird)
} else {
lowerThird.DisplayOrder = oldLowerThird.DisplayOrder
err = web.arena.Database.UpdateLowerThird(lowerThird)
}
if err != nil {
Expand Down

0 comments on commit cc4ceb1

Please sign in to comment.