editor.ClickToEditWrapper Extends goog.Disposable
Initialize the wrapper, and begin listening to mouse events immediately.

Inheritance

Constructor

goog.editor.ClickToEditWrapper(fieldObj)

Parameters

fieldObj : goog.editor.Field
The editable field being wrapped.

Instance Methods

Public Protected Private
disposeInternal()
No description.
code »
ensureFieldEditable_()
Ensure that the field is editable. If the field is not editable, make it so, and record the fact that it was done by a user mouse event.
code »
enterDocument()
Initialize listeners when the uneditable field is added to the document. Also sets up lorem ipsum text.
code »
exitDocument()
Destroy listeners when the field is removed from the document.
code »
finishMouseUp_()
A helper function for handleMouseUp_ -- does the actual work when the event is finished propagating.
code »
focusOnFieldObj(field)
Focus on the field object.
Arguments:
field : goog.editor.Field
The field to focus.
code »
getElement() Element
Returns the uneditable field element if the field is not yet editable (equivalent to EditableField.getOriginalElement()), and the editable DOM element if the field is currently editable (equivalent to EditableField.getElement()).
Returns: Element  The element containing the editable field contents.
code »
getFieldObject() goog.editor.Field
No description.
Returns: goog.editor.Field  The field.
code »
getOriginalDomHelper() goog.dom.DomHelper
No description.
Returns: goog.dom.DomHelper  The dom helper of the uneditable element.
code »
handleClick_(e)
Handle mouse click events on the field.
Arguments:
e : goog.events.BrowserEvent
The click event.
code »
handleMouseUp_(e)
Handle a mouse up event on the field.
Arguments:
e : goog.events.BrowserEvent
The mouseup event.
code »
insertCarets_()
Inserts the carets, given the current selection. Note that for all practical purposes, a cursor position is just a selection with the start and end at the same point.
code »
makeFieldEditable(field)
Make the field object editable.
Arguments:
field : goog.editor.Field
The field to make editable.
code »
renderSelection_()
Once the field has loaded in an iframe, re-create the selection as marked by the carets.
code »
shouldHandleMouseEvent_(e) boolean
True if a mouse event should be handled, false if it should be ignored.
Arguments:
e : goog.events.BrowserEvent
The mouse event.
Returns: boolean  Wether or not this mouse event should be handled.
code »
addOnDisposeCallback(callbackopt_scope)
Invokes a callback function when this object is disposed. Callbacks are invoked in the order in which they were added.
Arguments:
callback : function(this:T):?
The callback function.
opt_scope : T=
An optional scope to call the callback in.
code »
dispose() void
Disposes of the object. If the object hasn't already been disposed of, calls #disposeInternal. Classes that extend goog.Disposable should override #disposeInternal in order to delete references to COM objects, DOM nodes, and other disposable objects. Reentrant.
Returns: void  Nothing.
code »
disposeInternal()
Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend goog.Disposable should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' disposeInternal method. Everywhere else the public dispose method must be used. For example:
  mypackage.MyClass = function() {
    mypackage.MyClass.base(this, 'constructor');
    // Constructor logic specific to MyClass.
    ...
  };
  goog.inherits(mypackage.MyClass, goog.Disposable);

  mypackage.MyClass.prototype.disposeInternal = function() {
    // Dispose logic specific to MyClass.
    ...
    // Call superclass's disposeInternal at the end of the subclass's, like
    // in C++, to avoid hard-to-catch issues.
    mypackage.MyClass.base(this, 'disposeInternal');
  };
code »
getDisposed() boolean
Use #isDisposed instead. No description.
Returns: boolean  Whether the object has been disposed of.
code »
isDisposed() boolean
No description.
Returns: boolean  Whether the object has been disposed of.
code »
registerDisposable(disposable)
Associates a disposable object with this object so that they will be disposed together.
Arguments:
disposable : goog.disposable.IDisposable
that will be disposed when this object is disposed.
code »

Instance Properties

constructor :
No description.
Code »
fieldEventHandler_ : goog.events.EventHandler
Event handler for field related events.
Code »
fieldObj_ : goog.editor.Field
The field this wrapper interacts with.
Code »
finishMouseUpBound_ :
Bound version of the finishMouseUp method.
Code »
logger_ : goog.debug.Logger
The logger for this class.
Code »
mouseEventHandler_ : goog.events.EventHandler
Event handler for mouse events.
Code »
originalDomHelper_ : goog.dom.DomHelper
DOM helper for the field's original element.
Code »
savedCaretRange_ : goog.dom.SavedCaretRange
No description.
Code »
creationStack :
If monitoring the goog.Disposable instances is enabled, stores the creation stack trace of the Disposable instance.
Code »
disposed_ :
Whether the object has been disposed of.
Code »
onDisposeCallbacks_ :
Callbacks to invoke when this object is disposed.
Code »

Static Methods

goog.editor.ClickToEditWrapper.createCaretRange_(range) goog.dom.SavedCaretRange
Gets a saved caret range for the given range.
Arguments:
range : goog.dom.AbstractRange
A range wrapper.
Returns: goog.dom.SavedCaretRange  The range, saved with carets, or null if the range wrapper was null.
code »

Static Properties

goog.editor.ClickToEditWrapper.superClass_ :
No description.
Code »

Package editor

Package Reference