Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixes #2182 - Element.erase('html') should set the innerHTML to an em…
…pty string.

Element.properties.html.erase was aliased to Element.properties.html.set, but when calling it without any arguments this resulted in .set(undefined).
  • Loading branch information
Arian committed Dec 24, 2011
1 parent 1959959 commit 4adb41a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions Source/Element/Element.js
Expand Up @@ -920,6 +920,7 @@ Element.Properties.html = (function(){
var html = {
set: function(html){
if (typeOf(html) == 'array') html = html.join('');
else if (!html) html = '';

var wrap = (!tableTest && translations[this.get('tag')]);
/*<ltIE9>*/
Expand Down
8 changes: 8 additions & 0 deletions Specs/1.4client/Element/Element.js
Expand Up @@ -162,6 +162,14 @@ describe('Element', function(){

});

describe("Element.erase('html')", function(){

it('should empty the html inside an element', function(){
expect(new Element('div', {html: '<p>foo bar</p>'}).erase('html').innerHTML).toEqual('');
});

});

describe('Element.clone', function(){

it('should not crash IE for multiple clones', function(){
Expand Down

0 comments on commit 4adb41a

Please sign in to comment.