This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Added 'dimensions' option.

  • Loading branch information...
1 parent d1ed4b4 commit 7790ae4d45de24642cab5029ad618cefe93f0868 unknown committed Jul 18, 2010
Showing with 5 additions and 2 deletions.
  1. +2 −0 Docs/MooEditable/MooEditable.md
  2. +3 −2 Source/MooEditable/MooEditable.js
@@ -49,6 +49,8 @@ MooEditable Method: constructor {#MooEditable:constructor}
<body>{CONTENT}</body>
</html>
* rootElement - (*string*: defaults to 'p') A string indicating the root element of the editor content.
+* baseURL - (*string*: defaults to null) A string indicating the editor content's base URL for resolving relative URLs.
+* dimensions - (*object*: defaults to null) An object with x/y values indicating the width and height of the editor. Useful when the editor is not displayed when initialized.
### Events:
@@ -65,7 +65,8 @@ this.MooEditable = new Class({
externalCSS: '',
html: '<!DOCTYPE html><html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">{BASEHREF}<style>{BASECSS} {EXTRACSS}</style>{EXTERNALCSS}</head><body></body></html>',
rootElement: 'p',
- baseURL: ''
+ baseURL: '',
+ dimensions: null
},
initialize: function(el, options){
@@ -108,7 +109,7 @@ this.MooEditable = new Class({
var self = this;
// Dimensions
- var dimensions = this.textarea.getSize();
+ var dimensions = this.options.dimensions || this.textarea.getSize();
// Build the container
this.container = new Element('div', {

0 comments on commit 7790ae4

Please sign in to comment.