\r
kiwi.view.TopicBar = Backbone.View.extend({\r
events: {\r
- 'keydown input': 'process'\r
+ 'keydown div': 'process'\r
},\r
\r
initialize: function () {\r
\r
process: function (ev) {\r
var inp = $(ev.currentTarget),\r
- inp_val = inp.val();\r
-\r
- if (ev.keyCode !== 13) return;\r
-\r
+ inp_val = inp.text();\r
+ \r
if (kiwi.app.panels.active.isChannel()) {\r
+ if (ev.keyCode !== 13) return;\r
+\r
kiwi.gateway.topic(kiwi.app.panels.active.get('name'), inp_val);\r
}\r
+ \r
+ return false;\r
},\r
\r
setCurrentTopic: function (new_topic) {\r
new_topic = new_topic || '';\r
\r
// We only want a plain text version\r
- new_topic = $('<div>').html(formatIRCMsg(new_topic));\r
- $('input', this.$el).val(new_topic.text());\r
+ $('div', this.$el).html(formatIRCMsg(_.escape(new_topic)));\r
}\r
});\r
\r
}\r
\r
// If we're typing into an input box somewhere, ignore\r
- if (ev.target.tagName.toLowerCase() === 'input') {\r
+ if ((ev.target.tagName.toLowerCase() === 'input') || (ev.target.id === 'edittopic')) {\r
return;\r
}\r
\r