@@ -123,7 +123,6 @@ s.addOperation(
123123)
124124
125125var observer ;
126- var timeout ;
127126
128127export default class AcademicSubquery extends Morph {
129128 constructor ( ) {
@@ -134,22 +133,16 @@ export default class AcademicSubquery extends Morph {
134133 this . updateView ( )
135134
136135 observer = new MutationObserver ( ( mutations ) => {
137- mutations . forEach ( mutation => {
138- //lively.notify("observation", mutation.type)
139- clearTimeout ( timeout ) ;
140- timeout = setTimeout ( async ( ) => {
141- if ( mutation . type == "characterData" ) {
142- this . textContent = await this . viewToQuery ( ) ;
143- }
144- if ( mutation . type == "childList" ) {
145- clearTimeout ( timeout ) ;
146- //timeout = setTimeout(() => {
147- var div = < div id = "update" > </ div > ;
148- this . appendChild ( div ) ;
149- this . removeChild ( div ) ;
150- //}, 3000);
151- }
152- } , 1000 ) ;
136+ mutations . forEach ( async mutation => {
137+ if ( mutation . type == "characterData" ) {
138+ this . textContent = await this . viewToQuery ( ) ;
139+ }
140+ if ( mutation . type == "childList" ) {
141+ // TODO: better propagation to super elements
142+ var div = < div id = "update" > </ div > ;
143+ this . appendChild ( div ) ;
144+ this . removeChild ( div ) ;
145+ }
153146 } )
154147 } ) ;
155148
@@ -389,13 +382,13 @@ export default class AcademicSubquery extends Morph {
389382 class = "button"
390383 click = { ( ) => {
391384 this . setQuery (
392- "And(" + this . textContent + ", A='Placeholder' )" )
385+ "And(" + this . textContent + ", " + this . textContent + " )")
393386 } } > AND</ button >
394387 < button
395388 class = "button"
396389 click = { ( ) => {
397390 this . setQuery (
398- "Or(" + this . textContent + ", A='Placeholder' )" )
391+ "Or(" + this . textContent + ", " + this . textContent + " )")
399392 } } > OR</ button >
400393 </ span >
401394 </ span > ;
0 commit comments