https://github.com/mojotech/pioneer.iframe
Pioneer widget for iframes
https://github.com/mojotech/pioneer.iframe
Last synced: about 1 month ago
JSON representation
Pioneer widget for iframes
- Host: GitHub
- URL: https://github.com/mojotech/pioneer.iframe
- Owner: mojotech
- License: mit
- Created: 2014-08-01T14:43:02.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-04T01:25:25.000Z (about 12 years ago)
- Last Synced: 2026-05-18T11:36:42.025Z (3 months ago)
- Language: CoffeeScript
- Size: 145 KB
- Stars: 0
- Watchers: 46
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Pioneer Iframe
=====================
[](https://travis-ci.org/mojotech/pioneer.iframe)
[](https://gitter.im/mojotech/pioneer)
`Widget.Iframe` is a utility class that extends from the base `Pioneer` `Widget` Class.
## Table of contents
* [Installing](#installing)
* [Using](#Using)
* [Api](#api)
* [Focus](#focus)
* [Unfocus](#unfocus)
## Installing
npm install pioneer.iframe
## Using
pioneer --require node_modules/pioneer.iframe/lib
```js
MyFrame = Widget.Iframe.extend({
root: "iframe"
});
frame = new MyFrame();
// Changing the context to interact with the contents of the iframe
frame.focus();
// Resetting the context to interact with the iframes parent.
frame.unfocus();
```
# API
## Focus
`function focus()...`
Switches context from the default window to the iframe. All subsequent methods will be performed in the iframe until `unfocus()` is called.
Returns a promise that resolves to the widget instance on which it was called
## Unfocus
`function unfocus()...`
Switches context back to the default window (or the parent of the iframe).
Returns a promise that resolves to the widget instance on which it was called