Classes
Components
Modules
Surface
Abstract Component defined in packages/surface/Surface.js#27 inherits from
Abstract interface for editing components. Dances with contenteditable, so you don't have to.
new Surface()
Constructor defined in packages/surface/Surface.js#28
this.transaction(transformation)
Method defined in packages/surface/Surface.js#274
Run a transformation as a transaction properly configured for this surface.
Parameters
transformation | a transformation function(tx, args) which receives the selection the transaction was started with, and should return output arguments containing a selection, as well. |
Example
Returning a new selection:
surface.transaction(function(tx, args) {
var selection = args.selection;
...
selection = tx.createSelection(...);
return {
selection: selection
};
});
Adding event information to the transaction:
surface.transaction(function(tx, args) {
tx.info.foo = 'bar';
...
});
this.setSelection()
Method defined in packages/surface/Surface.js#298
- Set the model selection and update the DOM selection accordingly
this.selectAll()
Method defined in packages/surface/Surface.js#350
Selects all text
this.insertText()
Method defined in packages/surface/Surface.js#369
Performs an model/transform/insertText transformation
this.delete()
Method defined in packages/surface/Surface.js#379
Performs a model/transform/deleteSelection transformation
this.softBreak()
Method defined in packages/surface/Surface.js#397
Inserts a soft break
this.copy()
Method defined in packages/surface/Surface.js#406
Copy the current selection. Performs a model/transform/copySelection transformation.
this.paste()
Method defined in packages/surface/Surface.js#414
Performs a model/transform/paste transformation