fix null instrument tooltips
This commit is contained in:
parent
3c18d7cf65
commit
1c23f095ab
|
|
@ -339,7 +339,7 @@
|
|||
|
||||
if ("instrument_list" in pending_rsvp_request && pending_rsvp_request.instrument_list != null) {
|
||||
$.each(pending_rsvp_request.instrument_list, function (index, instrument) {
|
||||
var instrumentId = instrument == null ? null : instrument.id;
|
||||
var instrumentId = context.JK.getInstrumentId(instrument.id);
|
||||
var inst = context.JK.getInstrumentIcon24(instrumentId);
|
||||
instrumentLogoHtml += '<img title="' + instrumentId + '" hoveraction="instrument" data-instrument-id="' + instrumentId + '" src="' + inst + '" width="24" height="24" /> ';
|
||||
instrumentDesc.push(instrumentId);
|
||||
|
|
@ -378,7 +378,7 @@
|
|||
$.each(sessionData.approved_rsvps, function(index, approved_rsvp) {
|
||||
if ("instrument_list" in approved_rsvp) {
|
||||
$.each(approved_rsvp.instrument_list, function(index, instrument) {
|
||||
var instrumentId = instrument == null ? null : instrument.id;
|
||||
var instrumentId = context.JK.getInstrumentId(instrument.id);
|
||||
var inst = context.JK.getInstrumentIcon24(instrumentId);
|
||||
instrumentLogoHtml += '<img title="' + instrumentId + '" hoveraction="instrument" data-instrument-id="' + instrumentId + '" src="' + inst + '" width="24" height="24" /> ';
|
||||
});
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
instrumentHtml = '<td><div class="nowrap">';
|
||||
if (val.instruments) { // @FIXME: edge case for Test user that has no instruments?
|
||||
$.each(val.instruments, function(index, instrument) {
|
||||
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(instrument.instrument_id) + '" title="' + instrument.instrument_id + '" width="24" height="24" /> ';
|
||||
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(instrument.instrument_id) + '" title="' + context.JK.getInstrumentId(instrument.instrument_id) + '" width="24" height="24" /> ';
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
// instruments
|
||||
var instrumentHtml = '';
|
||||
$.each(response.instruments, function(index, val) {
|
||||
instrumentHtml += '<div class="left mr10 mb"><img src="' + context.JK.getInstrumentIcon24(val.instrument_id) + '" title="' + val.instrument_id + '" width="24" height="24" /></div>';
|
||||
instrumentHtml += '<div class="left mr10 mb"><img src="' + context.JK.getInstrumentIcon24(val.instrument_id) + '" title="' + context.JK.getInstrumentId(val.instrument_id) + '" width="24" height="24" /></div>';
|
||||
});
|
||||
|
||||
// followings
|
||||
|
|
@ -88,7 +88,7 @@
|
|||
|
||||
var latencyBadge = context._.template(
|
||||
$templateLatency.html(),
|
||||
$.extend(sessionUtils.createLatency(response), response),
|
||||
$.extend(response, sessionUtils.createLatency(response)),
|
||||
{variable: 'data'}
|
||||
);
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
instrumentHtml = '<td><div class="nowrap">';
|
||||
$.each(val.instrument_ids, function(index, val) {
|
||||
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(val) + '" title="' + val + '" width="24" height="24" /> ';
|
||||
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(val) + '" title="' + context.JK.getInstrumentId(val) + '" width="24" height="24" /> ';
|
||||
});
|
||||
instrumentHtml += '</div></td>';
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
instrumentHtml = '<td><div class="nowrap">';
|
||||
var instruments = val.instruments.split("|");
|
||||
$.each(instruments, function(index, instrument) {
|
||||
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(instrument) + '" title="' + instrument + '" width="24" height="24" /> ';
|
||||
instrumentHtml += '<img src="' + context.JK.getInstrumentIcon24(instrument) + '" title="' + context.JK.getInstrumentId(instrument) + '" width="24" height="24" /> ';
|
||||
});
|
||||
|
||||
instrumentHtml += '</div></td>';
|
||||
|
|
|
|||
|
|
@ -380,7 +380,7 @@
|
|||
var track = participant.tracks[j];
|
||||
logger.debug("Find:Finding instruments. Participant tracks:", participant.tracks);
|
||||
var inst = context.JK.getInstrumentIcon24(track.instrument_id);
|
||||
instrumentLogoHtml += '<img title="' + track.instrument_id + '" hoveraction="instrument" data-instrument-id="' + track.instrument_id + '" src="' + inst + '" width="24" height="24" /> ';
|
||||
instrumentLogoHtml += '<img title="' + context.JK.getInstrumentId(track.instrument_id) + '" hoveraction="instrument" data-instrument-id="' + track.instrument_id + '" src="' + inst + '" width="24" height="24" /> ';
|
||||
}
|
||||
|
||||
var id = participant.user.id;
|
||||
|
|
@ -411,7 +411,7 @@
|
|||
for (j=0; j < user.instrument_list.length; j++) {
|
||||
var instrument = user.instrument_list[j];
|
||||
var inst = context.JK.getInstrumentIcon24(instrument.id);
|
||||
instrumentLogoHtml += '<img title="' + instrument.id + '" hoveraction="instrument" data-instrument-id="' + instrument.id + '" src="' + inst + '" width="24" height="24" /> ';
|
||||
instrumentLogoHtml += '<img title="' + context.JK.getInstrumentId(instrument.id) + '" hoveraction="instrument" data-instrument-id="' + instrument.id + '" src="' + inst + '" width="24" height="24" /> ';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,6 +88,7 @@
|
|||
var instrumentIconMap24 = {};
|
||||
var instrumentIconMap45 = {};
|
||||
var instrumentIconMap256 = {};
|
||||
var notSpecifiedText = "Not specified";
|
||||
|
||||
$.each(icon_map_base, function (instrumentId, icon) {
|
||||
instrumentIconMap24[instrumentId] = {asset: "/assets/content/icon_instrument_" + icon + "24.png", name: instrumentId};
|
||||
|
|
@ -507,6 +508,14 @@
|
|||
return instrumentIconMap256["_default"].asset;
|
||||
};
|
||||
|
||||
context.JK.getInstrumentId = function(instrumentId) {
|
||||
if (instrumentId) {
|
||||
return instrumentId ? instrumentId : notSpecifiedText;
|
||||
}
|
||||
|
||||
return notSpecifiedText;
|
||||
}
|
||||
|
||||
// meant to pass in a bunch of images with an instrument-id attribute on them.
|
||||
|
||||
context.JK.setInstrumentAssetPath = function ($elements) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue