summaryrefslogtreecommitdiff
path: root/www/js/jingles.js
diff options
context:
space:
mode:
authorChristian Pointner <equinox@helsinki.at>2016-09-08 14:34:26 (GMT)
committerChristian Pointner <equinox@helsinki.at>2016-09-08 14:34:26 (GMT)
commitdc101335c8b629f6f244a7fc88fa74bc4e88a9fd (patch)
treedf29795c6386d59a1af73c257b726dc8b1cc58d9 /www/js/jingles.js
parent2debb223570fbe5e9735cc256e342065d3c99c00 (diff)
honor evergreen flag on jingles cuts
Diffstat (limited to 'www/js/jingles.js')
-rw-r--r--www/js/jingles.js14
1 files changed, 12 insertions, 2 deletions
diff --git a/www/js/jingles.js b/www/js/jingles.js
index 78c2675..2a269cd 100644
--- a/www/js/jingles.js
+++ b/www/js/jingles.js
@@ -189,7 +189,13 @@ Rdxport.JingleCartView = function(model, groupView, active) {
var self = this;
if (this.model) {
- $(this.model.cuts).each(function(index, cut) {
+ $(this.model.cuts).sort(function(a, b) {
+ if(a.isEvergreen == b.isEvergreen)
+ return 0;
+ if(a.isEvergreen)
+ return 1;
+ return -1;
+ }).each(function(index, cut) {
cut.active = self.active;
var cutView = new Rdxport.JingleCutView(cut);
@@ -239,7 +245,11 @@ Rdxport.JingleCutView.prototype.render = function() {
var activateButton;
if (this.model.active) {
activateButton = $('<button class="btn btn-warning btn-xs"><span class="glyphicon glyphicon-ban-circle"></span>&nbsp;&nbsp;Deaktivieren</button>');
- status.addClass('label-success').html('<span class="glyphicon glyphicon-ok"></span>');
+ if (!this.model.isEvergreen) {
+ status.addClass('label-success').html('<span class="glyphicon glyphicon-star"></span>');
+ } else {
+ status.addClass('label-info').html('<span class="glyphicon glyphicon-star-empty"></span>');
+ }
} else {
activateButton = $('<button class="btn btn-success btn-xs"><span class="glyphicon glyphicon-ok"></span>&nbsp;&nbsp;Aktivieren</button>');
status.addClass('label-warning').html('<span class="glyphicon glyphicon-ban-circle"></span>');