From: Nick Fisher Date: Fri, 19 Dec 2014 01:03:57 +0000 (+0100) Subject: Return a jquery object from the mediamessage handler X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=75381955d85fcedca39e1be3cecaa08a51e5560b;p=KiwiIRC.git Return a jquery object from the mediamessage handler Avoids 'reaching' outside where this method should be reaching. --- 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() {