fixed when chat message is empty, show space

This commit is contained in:
OldHawk
2017-05-15 13:40:06 +08:00
parent de12b3c0e6
commit 4c859ad97b
2 changed files with 13 additions and 8 deletions

View File

@@ -224,10 +224,16 @@
* @param evt
*/
vm.onInputKeyDown = function (evt) {
if (evt.keyCode === 13 && vm.messageText) {
vm.sendMessage();
//evt.stopPropagation();
evt.preventDefault();
if (evt.keyCode === 13) {
if (evt.shiftKey) {
return;
} else {
if (vm.messageText) {
vm.sendMessage();
//evt.stopPropagation();
evt.preventDefault();
}
}
}
};
@@ -318,6 +324,8 @@
vm.getMessageText = function (msg) {
var newmsg = msg.text;
newmsg = newmsg.replace(/(?:\r\n|\r|\n)/g, '<br />');
var matches = newmsg.match(/\[@(.*?)\]/g);
angular.forEach(matches, function (m) {
var atu = m.substr(1, m.length - 2);
@@ -326,7 +334,7 @@
});
if (msg.fontColor) {
newmsg = '<font color="' + msg.fontColor + '">' + newmsg + '</font>';
newmsg = '<font color="' + msg.fontColor + '">' + (newmsg || '&nbsp;') + '</font>';
}
return newmsg || '&nbsp;';

View File

@@ -17,10 +17,7 @@
var mtScale = JSON.parse(JSON.stringify(eval('(' + attrs.mtScale + ')')));
console.log(mtScale);
element.css('transition-property', 'transform, opacity');
console.log('mtScale.duration=' + mtScale.duration);
element.css('transition-duration', mtScale.duration || '.5s');
element.css('transition-timing-function', mtScale.function || 'ease');