Constructor
new ve.ce.SurfaceObserver(surface)
#
ContentEditable surface observer.
Parameters:
Name | Type | Description |
---|---|---|
surface |
ve.ce.Surface | Surface to observe |
- Source:
Methods
clear()
#
Clear polling data.
- Source:
detach()
#
Detach from the document view
- Source:
disable()
#
Disable the surface observer
- Source:
enable()
#
Enable the surface observer
- Source:
getRange() → {ve.Range|null
}
#
null
}
#
Get the range last observed.
Used when you have just polled, but don't want to wait for a 'rangeChange' event.
- Source:
Returns:
- Type
-
ve.Range
|
null
pollOnce()
#
Poll for changes.
- Source:
pollOnceInternal(signalChanges, selectionOnly)private
#
Poll for changes.
Parameters:
Name | Type | Description |
---|---|---|
signalChanges |
boolean | If there changes are observed, call Surface#handleObservedChange |
selectionOnly |
boolean | Check for selection changes only |
- Source:
pollOnceNoCallback()
#
Poll to update SurfaceObserver, but don't signal any changes back to the Surface
- Source:
pollOnceSelection()
#
Poll to update SurfaceObserver, but only check for selection changes
Used as an optimisation when you know the content hasn't changed
- Source:
Poll to update SurfaceObserver, but only check for selection changes
Used as an optimisation when you know the content hasn't changed
setTimeout(callback, timeout) → {number}
#
Wrapper for setTimeout, for ease of debugging
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | |
timeout |
number | Timeout ms |
- Source:
Returns:
Timeout ID
- Type
- number
startTimerLoop()
#
Start the setTimeout synchronisation loop
- Source:
stopTimerLoop()
#
Stop polling
- Source:
timerLoop(firstTime)
#
Loop once with setTimeout
Parameters:
Name | Type | Description |
---|---|---|
firstTime |
boolean | Wait before polling |
- Source:
setTimeout