Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
- MooToolizes the Element.prototype.
Browse files Browse the repository at this point in the history
- passing state values to activate()
  • Loading branch information
cheeaun committed Feb 22, 2009
1 parent 62fd350 commit 2d211d3
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Source/MooEditable/MooEditable.js
Expand Up @@ -178,9 +178,9 @@ var MooEditable = new Class({
// document.window for IE, for new Document code below
if (Browser.Engine.trident) this.doc.window = this.win;

// Mootoolize document and body
// Mootoolize document and Element
if (!this.doc.$family) new Document(this.doc);
$(this.doc.body);
$extend(this.win.Element.prototype, Element.Prototype);

// Bind keyboard shortcuts
this.doc.addEvents({
Expand Down Expand Up @@ -336,7 +336,8 @@ var MooEditable = new Class({

if (el) do {
if ($type(el) != 'element') break;
if (states.tags.contains(el.tagName.toLowerCase())) item.activate();
var tag = el.tagName.toLowerCase();
if (states.tags.contains(tag)) item.activate(tag);
}
while (el = el.parentNode);
}
Expand All @@ -346,9 +347,10 @@ var MooEditable = new Class({

if (el) do {
if ($type(el) != 'element') break;
for (var prop in states.css)
if ($(el).getStyle(prop).contains(states.css[prop]))
item.activate();
for (var prop in states.css){
var css = states.css[prop];
if (Element.getStyle(el, prop).contains(css)) item.activate(css, css[prop]);
}
}
while (el = el.parentNode);
}
Expand Down

0 comments on commit 2d211d3

Please sign in to comment.