summaryrefslogtreecommitdiff
path: root/www/js/musicgrid.js
diff options
context:
space:
mode:
Diffstat (limited to 'www/js/musicgrid.js')
-rw-r--r--www/js/musicgrid.js11
1 files changed, 8 insertions, 3 deletions
diff --git a/www/js/musicgrid.js b/www/js/musicgrid.js
index bd219ff..e751b6c 100644
--- a/www/js/musicgrid.js
+++ b/www/js/musicgrid.js
@@ -87,7 +87,11 @@ Rivendell.MusicgridView.prototype.update = function() {
});
$('tr td:not(.clock)', this.$el).off().on('click', function() {
- musicpoolModal.selectClock($(this).parent().data('dow'), $(this).data('hour'), null);
+ musicpoolModal.selectClock(
+ $(this).parent().data('dow'),
+ $(this).data('hour'),
+ null
+ );
});
};
@@ -106,7 +110,8 @@ Rivendell.MusicpoolModal.prototype.selectClock = function(dow, hour, clockName)
$('tbody', $modalBody).html('');
var self = this;
- $(this.model).on('update', function() {
+ $(this.model).off().on('update', function() {
+ $('tbody tr', $modalBody).remove();
$(self.model.groups).each(function(index, musicpool) {
var $button = null;
if (clockName === musicpool.clock) {
@@ -118,7 +123,7 @@ Rivendell.MusicpoolModal.prototype.selectClock = function(dow, hour, clockName)
$button.on('click', function() {
rivendell.setMusicgrid(dow, hour, musicpool.clock, function() {
$('#musicpoolModal').modal('hide');
- musicgridView.modal.fetch();
+ musicgridView.model.fetch();
});
});