From 75381955d85fcedca39e1be3cecaa08a51e5560b Mon Sep 17 00:00:00 2001 From: Nick Fisher Date: Fri, 19 Dec 2014 02:03:57 +0100 Subject: [PATCH] Return a jquery object from the mediamessage handler Avoids 'reaching' outside where this method should be reaching. --- client/src/views/mediamessage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/client/src/views/mediamessage.js b/client/src/views/mediamessage.js index f86d99a..6351eb7 100644 --- a/client/src/views/mediamessage.js +++ b/client/src/views/mediamessage.js @@ -164,7 +164,7 @@ _kiwi.view.MediaMessage = Backbone.View.extend({ soundcloud: function () { var url = this.$el.data('url'), - $content = this.$content.find('.content'); + $content = $('
').text(_kiwi.global.i18n.translate('client_models_applet_loading').fetch()); $.getJSON('http://soundcloud.com/oembed', { url: url }) .then(function (data) { @@ -172,10 +172,10 @@ _kiwi.view.MediaMessage = Backbone.View.extend({ $(data.html).attr('height', data.height - 100) ); }, function () { - $content.html(_kiwi.global.i18n.translate('client_views_mediamessage_notfound').fetch()); + $content.text(_kiwi.global.i18n.translate('client_views_mediamessage_notfound').fetch()); }); - return _kiwi.global.i18n.translate('client_models_applet_loading').fetch(); + return $content; }, custom: function() { -- 2.25.1