mirror of
https://github.com/taobataoma/meanTorrent.git
synced 2026-05-07 01:25:43 +02:00
fixed when chat message is empty, show space
This commit is contained in:
@@ -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 || ' ') + '</font>';
|
||||
}
|
||||
|
||||
return newmsg || ' ';
|
||||
|
||||
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user