use of elemental2.dom.DomGlobal.setTimeout in project gwtproject by treblereel.
the class RichTextAreaImplStandard method initElement.
@Override
public void initElement() {
// Most browsers don"t like setting designMode until slightly _after_
// the iframe becomes attached to the DOM. Any non-zero timeout will do
// just fine.
RichTextAreaImplStandard _this = this;
_this.onElementInitializing();
DomGlobal.setTimeout((ignore) -> {
if (_this.elem != null) {
HTMLIFrameElement iframe = Js.uncheckedCast(_this.elem);
if (iframe.contentWindow != null) {
((JsPropertyMap) ((JsPropertyMap) iframe.contentWindow).get("document")).set("designMode", "On");
_this.onElementInitialized();
}
}
}, 1.0D, new Object[0]);
}
use of elemental2.dom.DomGlobal.setTimeout in project deephaven-core by deephaven.
the class JsTreeTable method snapshotQuery.
/**
* Requests an update from the server. Should only be called by itself and scheduleSnapshotQuery.
*/
private void snapshotQuery() {
if (closed) {
JsLog.warn("TreeTable already closed, cannot perform operation");
return;
}
// we're running now, so mark as already scheduled
scheduled = false;
if (firstRow == null || lastRow == null) {
// viewport not set yet, don't start loading data
return;
}
// clear any size update, we're getting data either way, future updates should be noted
nextSnapshotState = NextSnapshotState.TIMER_RUNNING;
viewportUpdateTimeoutId = DomGlobal.setTimeout(p -> {
// started
if (nextSnapshotState == NextSnapshotState.QUERY_WHEN_TIMER_ENDS) {
scheduleSnapshotQuery(false);
} else {
// otherwise, this means that we should query right away if any update arrives
nextSnapshotState = NextSnapshotState.QUERY_WHEN_UPDATE_SEEN;
}
}, updateInterval);
if (connection.isUsable()) {
running = true;
TreeTableRequest query = buildQuery();
Column[] queryColumns = this.columns;
boolean alwaysFireEvent = this.alwaysFireNextEvent;
this.alwaysFireNextEvent = false;
JsLog.debug("Sending tree table request", this, LazyString.of(baseTable::getHandle), query, alwaysFireEvent);
// }));
throw new UnsupportedOperationException("treeSnapshotQuery");
} else {
JsLog.debug("Connection not ready, skipping tree table poll", this);
}
}
Aggregations