Highlight active PM

This commit is contained in:
Guangcong Luo 2013-04-30 13:37:57 -07:00
parent 0c7c2db875
commit e1040e6529
2 changed files with 21 additions and 3 deletions

View File

@ -8,7 +8,9 @@
'keydown textarea': 'keyPress',
'click .username': 'clickUsername',
'click .closebutton': 'closePM',
'click .pm-window': 'clickPMBackground'
'click .pm-window': 'clickPMBackground',
'focus textarea': 'onFocusPM',
'blur textarea': 'onBlurPM'
},
initialize: function() {
// left menu
@ -78,7 +80,13 @@
this.$pmBox.find('.pm-window-'+userid).hide();
},
focusPM: function(name) {
this.openPM(name).find('textarea[name=message]').focus();
this.openPM(name).prependTo(this.$pmBox).find('textarea[name=message]').focus();
},
onFocusPM: function(e) {
$(e.currentTarget).closest('.pm-window').addClass('focused');
},
onBlurPM: function(e) {
$(e.currentTarget).closest('.pm-window').removeClass('focused');
},
keyPress: function(e) {
if (e.keyCode === 13 && !e.shiftKey) { // Enter

View File

@ -289,7 +289,7 @@ body {
margin-bottom: 12px;
}
.pm-window h3 {
background: #f8f8f8;
background: rgba(248,248,248,.8);
color: #777777;
margin: 0;
padding: 2px 5px;
@ -297,6 +297,7 @@ body {
border: 1px solid #AAAAAA;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
cursor: default;
}
.pm-window h3 .closebutton {
float: right;
@ -325,6 +326,15 @@ body {
.pm-window.collapsed .pm-log-add {
display: none;
}
.pm-window.focused h3,
.pm-window.focused .pm-log,
.pm-window.focused .pm-log.add {
border-color: #555555;
}
.pm-window.focused h3 {
background: #f8f8f8;
color: #222222;
}
.tiny-layout .leftmenu,
.tiny-layout .rightmenu,