Quellcode durchsuchen

pass the message parent element to allow deferred loading.

Lucas Stadler vor 11 Jahren
Ursprung
Commit
0e8972bb87
1 geänderte Dateien mit 3 neuen und 3 gelöschten Zeilen
  1. 3 3
      js/babl/public/index.html

+ 3 - 3
js/babl/public/index.html

@ -84,12 +84,12 @@
84 84
				}
85 85
			}, { re: /.*/, fn: function(match) { return new Text(match[0]); }}];
86 86
87
			function expandWord(word) {
87
			function expandWord(word, msgEl) {
88 88
				for (var i = 0; i < word_matchers.length; i++) {
89 89
					var matcher = word_matchers[i];
90 90
					var match = word.match(matcher.re);
91 91
					if (match) {
92
						return matcher.fn(match);
92
						return matcher.fn(match, msgEl);
93 93
					}
94 94
				}
95 95
			}
@ -101,7 +101,7 @@
101 101
				var words = msg.content.split(/\s/);
102 102
				for (var i = 0; i < words.length; i++) {
103 103
					msgEl.appendChild(new Text(" "));
104
					msgEl.appendChild(expandWord(words[i]));
104
					msgEl.appendChild(expandWord(words[i], msgEl));
105 105
				}
106 106
				messagesEl.appendChild(msgEl);
107 107
				if (window.scrollY >= window.scrollMaxY - 2 * inputEl.clientHeight) {