Home

# Class goog.editor.ClickToEditWrapper

Initialize the wrapper, and begin listening to mouse events immediately.

extends goog.Disposable

Instance Method Summary

`disposeInternal()`

Deletes or nulls out any references to COM objects, DOM nodes, or other disposable objects. Classes that extend {@code goog.Disposable} should override this method. Not reentrant. To avoid calling it twice, it must only be called from the subclass' {@code disposeInternal} method. Everywhere else the public {@code dispose} method must be used. For example:

    mypackage.MyClass = function() {
    goog.base(this);
    // Constructor logic specific to MyClass.
    ...
    };
    goog.inherits(mypackage.MyClass, goog.Disposable);

    mypackage.MyClass.prototype.disposeInternal = function() {
    goog.base(this, 'disposeInternal');
    // Dispose logic specific to MyClass.
    ...
    };

| `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.
| `enterDocument()` Initialize listeners when the uneditable field is added to the document. Also sets up lorem ipsum text.
| `exitDocument()` Destroy listeners when the field is removed from the document.
| `finishMouseUp_()` A helper function for handleMouseUp_ -- does the actual work when the event is finished propagating.
| `focusOnFieldObj(?goog.editor.Field field)` Focus on the field object.
| `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()).
| `getFieldObject() ⇒ ?goog.editor.Field`
| `getOriginalDomHelper() ⇒ ?goog.dom.DomHelper`
| `handleClick_(?goog.events.BrowserEvent e)` Handle mouse click events on the field.
| `handleMouseUp_(?goog.events.BrowserEvent e)` Handle a mouse up event on the field.
| `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.
| `makeFieldEditable(?goog.editor.Field field)` Make the field object editable.
| `renderSelection_()` Once the field has loaded in an iframe, re-create the selection as marked by the carets.
| `shouldHandleMouseEvent_(?goog.events.BrowserEvent e) ⇒ boolean` True if a mouse event should be handled, false if it should be ignored.

Static Method Summary
| `createCaretRange_(?goog.dom.AbstractRange range) ⇒ ?goog.dom.SavedCaretRange` Gets a saved caret range for the given range.