Skip to content

Commit

Permalink
Add support for the contenteditable attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
timmywil committed May 5, 2011
1 parent 5097e6d commit cccf9ad
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/attributes.js
Expand Up @@ -414,7 +414,8 @@ jQuery.extend({
rowspan: "rowSpan", rowspan: "rowSpan",
colspan: "colSpan", colspan: "colSpan",
usemap: "useMap", usemap: "useMap",
frameborder: "frameBorder" frameborder: "frameBorder",
contenteditable: "contentEditable"
}, },


prop: function( elem, name, value ) { prop: function( elem, name, value ) {
Expand Down
8 changes: 6 additions & 2 deletions test/unit/attributes.js
Expand Up @@ -22,7 +22,8 @@ test("jQuery.attrFix/jQuery.propFix integrity test", function() {
rowspan: "rowSpan", rowspan: "rowSpan",
colspan: "colSpan", colspan: "colSpan",
usemap: "useMap", usemap: "useMap",
frameborder: "frameBorder" frameborder: "frameBorder",
contenteditable: "contentEditable"
}, },
propsShouldBe; propsShouldBe;


Expand Down Expand Up @@ -143,7 +144,7 @@ test("attr(Hash)", function() {
}); });


test("attr(String, Object)", function() { test("attr(String, Object)", function() {
expect(56); expect(57);


var div = jQuery("div").attr("foo", "bar"), var div = jQuery("div").attr("foo", "bar"),
fail = false; fail = false;
Expand Down Expand Up @@ -215,6 +216,9 @@ test("attr(String, Object)", function() {
equals( $text.attr("aria-disabled", false).attr("aria-disabled"), "false", "Setting aria attributes are not affected by boolean settings"); equals( $text.attr("aria-disabled", false).attr("aria-disabled"), "false", "Setting aria attributes are not affected by boolean settings");
$text.removeData("something").removeData("another").removeAttr("aria-disabled"); $text.removeData("something").removeData("another").removeAttr("aria-disabled");


jQuery("#foo").attr("contenteditable", true);
equals( jQuery("#foo").attr("contenteditable"), "true", "Enumerated attributes are set properly" );

var attributeNode = document.createAttribute("irrelevant"), var attributeNode = document.createAttribute("irrelevant"),
commentNode = document.createComment("some comment"), commentNode = document.createComment("some comment"),
textNode = document.createTextNode("some text"); textNode = document.createTextNode("some text");
Expand Down

0 comments on commit cccf9ad

Please sign in to comment.