Expand all

ve.ce.SurfaceObserver

Constructor

new ve.ce.SurfaceObserver(surface) #

ContentEditable surface observer.

Parameters:

Name Type Description
surface ve.ce.Surface

Surface to observe

Source:
ContentEditable surface observer.

Methods

clear() #

Clear polling data.

Source:
Clear polling data.

detach() #

Detach from the document view

Source:
Detach from the document view

disable() #

Disable the surface observer

Source:
Disable the surface observer

enable() #

Enable the surface observer

Source:
Enable the surface observer

getRange() → {ve.Range|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
Get the range last observed.

pollOnce() #

Poll for changes.

Source:
Poll for changes.

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:
Poll for changes.

pollOnceNoCallback() #

Poll to update SurfaceObserver, but don't signal any changes back to the Surface

Source:
Poll to update SurfaceObserver, but don't signal any changes back to the Surface

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
Wrapper for setTimeout, for ease of debugging

startTimerLoop() #

Start the setTimeout synchronisation loop

Source:
Start the setTimeout synchronisation loop

stopTimerLoop() #

Stop polling

timerLoop(firstTime) #

Loop once with setTimeout

Parameters:

Name Type Description
firstTime boolean

Wait before polling

Source:
Loop once with setTimeout