Fixed an IE bug and fixed a bug in sendPresence.

This commit is contained in:
JC Brand 2013-05-20 20:59:57 +02:00
parent 0799d286fb
commit 316d3f3396
2 changed files with 9 additions and 16 deletions

View File

@ -801,10 +801,6 @@ form.add-xmpp-contact input {
z-index: 22; z-index: 22;
} }
.chatbox .dropdown span.value {
display:none;
}
.chatbox .dropdown a { .chatbox .dropdown a {
padding: 3px 0 0 25px; padding: 3px 0 0 25px;
display: block; display: block;

View File

@ -1869,8 +1869,8 @@
bare_jid = Strophe.getBareJidFromJid(jid), bare_jid = Strophe.getBareJidFromJid(jid),
resource = Strophe.getResourceFromJid(jid), resource = Strophe.getResourceFromJid(jid),
presence_type = $presence.attr('type'), presence_type = $presence.attr('type'),
show = $presence.find('show'), $show = $presence.find('show'),
chat_status = show.text() || 'online', chat_status = $show.text() || 'online',
status_message = $presence.find('status'), status_message = $presence.find('status'),
item; item;
@ -2107,7 +2107,7 @@
if (type === 'online') { if (type === 'online') {
presence = $pres(); presence = $pres();
} else { } else {
presence = $pres().c('show').t(type); presence = $pres().c('show').t(type).up();
} }
if (status_message) { if (status_message) {
presence.c('status').t(status_message); presence.c('status').t(status_message);
@ -2150,8 +2150,8 @@
status_template: _.template( status_template: _.template(
'<div class="xmpp-status">' + '<div class="xmpp-status">' +
'<a class="choose-xmpp-status {{ chat_status }}" href="#" title="Click to change your chat status">' + '<a class="choose-xmpp-status {{ chat_status }}" data-value="{{status_message}}" href="#" title="Click to change your chat status">' +
'{{ status_message }} <span class="value">{{ status_message }}</span>' + '{{ status_message }}' +
'</a>' + '</a>' +
'<a class="change-xmpp-status-message" href="#" Title="Click here to write a custom status message"></a>' + '<a class="change-xmpp-status-message" href="#" Title="Click here to write a custom status message"></a>' +
'</div>'), '</div>'),
@ -2174,8 +2174,8 @@
setStatus: function (ev) { setStatus: function (ev) {
ev.preventDefault(); ev.preventDefault();
var $el = $(ev.target).find('span'), var $el = $(ev.target),
value = $el.text(); value = $el.attr('data-value');
this.model.setStatus(value); this.model.setStatus(value);
this.$el.find(".dropdown dd ul").hide(); this.$el.find(".dropdown dd ul").hide();
}, },
@ -2214,10 +2214,7 @@
option_template: _.template( option_template: _.template(
'<li>' + '<li>' +
'<a href="#" class="{{ value }}">' + '<a href="#" class="{{ value }}" data-value="{{ value }}">{{ text }}</a>' +
'{{ text }}' +
'<span class="value">{{ value }}</span>' +
'</a>' +
'</li>'), '</li>'),
initialize: function () { initialize: function () {
@ -2241,7 +2238,7 @@
// iterate through all the <option> elements and add option values // iterate through all the <option> elements and add option values
options.each(function(){ options.each(function(){
options_list.push(that.option_template({'value': $(this).val(), options_list.push(that.option_template({'value': $(this).val(),
'text': $(this).text() 'text': this.text
})); }));
}); });
$options_target = this.$el.find("#target dd ul").hide(); $options_target = this.$el.find("#target dd ul").hide();