Home

# Class goog.editor.SeamlessField

This class encapsulates an editable field that blends in with the surrounding page. To see events fired by this object, please see the base class.

extends goog.editor.Field

Instance Method Summary
| `acquireSizeIframeLockGecko_() ⇒ boolean` Acquires a lock on resizing the field iframe. This is used to ensure that modifications we make while in a mutation event handler don't cause infinite loops.
| `attachIframe(?HTMLIFrameElement iframe)` Given the original field element, and the iframe that is destined to become the editable field, styles them appropriately and add the iframe to the dom.
| `autoDetectFixedHeight_()` Auto-detect whether the current field should have a fixed height.
| `dispatchBlur()` Dispatches a blur event.

`disposeInternal()`

Unattach listeners from this object. Classes that extend EventTarget may need to override this method in order to remove references to DOM Elements and additional listeners, it should be something like this:

    MyClass.prototype.disposeInternal = function() {
    MyClass.superClass_.disposeInternal.call(this);
    // Dispose logic for MyClass
    };

| `doFieldSizingGecko()` Perform all the sizing immediately.
| `getFieldFormatInfo(?Object extraStyles) ⇒ ?goog.editor.icontent.FieldFormatInfo`
| `getIframeAttributes() ⇒ ?Object`
| `getIframeBodyHeightGecko_() ⇒ number`
| `getIframeableCss(boolean= opt_forceRegeneration) ⇒ string` Gets the css rules that should be used to style an iframe's body as if it were the original element that we made editable.
| `handleChange()` Handle a change in the Editable Field. Marks the field has modified, dispatches the change event on the editable field (moz only), starts the timer for the delayed change event. Note that these actions only occur if the proper events are not stopped.
| `handleFieldLoad()` Handle the loading of the field (e.g. once the field is ready to setup). TODO(user): this should probably just be moved into dispatchLoadEvent_.
| `handleOuterDocChange_()` Resize the iframe in response to the wrapper div changing size.
| `inheritBlendedCSS()` Applies CSS from the wrapper-div to the field iframe.
| `installStyles()` Installs styles if needed. Only writes styles when they can't be written inline directly into the field.
| `isFixedHeight() ⇒ boolean`
| `makeEditableInternal(string= opt_iframeSrc)` Handles actually making something editable - creating necessary nodes, injecting content, etc.
| `overrideFixedHeight(boolean newVal)`
| `releaseSizeIframeLockGecko_()` Releases a lock on resizing the field iframe. This is used to ensure that modifications we make while in a mutation event handler don't cause infinite loops.
| `restoreDom()` Restores the dom to how it was before being made editable.
| `setIframeableCss(string iframeableCss)` Sets the css rules that should be used inside the editable iframe. Note: to clear the css cache between makeNotEditable/makeEditable, call this with "" as iframeableCss. TODO(user): Unify all these css setting methods + Nick's open CL. This is getting ridiculous.
| `setMinHeight(number height)` Sets the min height of this editable field's iframe. Only used in growing mode when an iframe is used. This will cause an immediate field sizing to update the field if necessary based on the new min height.
| `setupMutationEventHandlersGecko()` Mutation events tell us when something has changed for mozilla.
| `sizeIframeToBodyHeightGecko_()` Sizes the iframe to its body's height.
| `sizeIframeToWrapperGecko_()` Sizes the iframe to its container div's width. The width of the div is controlled by its containing context, not by its contents. if it extends outside of it's contents, then it gets a horizontal scroll.
| `turnOnDesignModeGecko()` Attemps to turn on designMode for a document. This function can fail under certain circumstances related to the load event, and will throw an exception.
| `writeIframeContent(?HTMLIFrameElement iframe, string innerHtml, ?Object extraStyles)` Writes the html content into the iframe. Handles writing any aditional styling as well.

Static Method Summary
| `getScrollbarWidth_() ⇒ number` Grabs the width of a scrollbar from the browser and caches the result.