Skip to content

Fixes #2182 - Element.erase('html') should set the innerHTML to an empty string #2187

Merged
merged 1 commit into from Jan 7, 2012

2 participants

@arian
MooTools member
arian commented Dec 24, 2011

Element.properties.html.erase was aliased to Element.properties.html.set, but when calling it without any arguments this resulted in .set(undefined).

See #2182

@arian arian 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).
4adb41a
@ibolmo ibolmo commented on the diff Dec 24, 2011
Source/Element/Element.js
@@ -920,6 +920,7 @@ Element.Properties.html = (function(){
var html = {
set: function(html){
if (typeOf(html) == 'array') html = html.join('');
+ else if (!html) html = '';
@ibolmo
MooTools member
ibolmo added a note Dec 24, 2011

should we check for html == undefined reason being false, 0, and any toValue that returns falsy

@arian
MooTools member
arian added a note Dec 24, 2011

hm, yeah, probably if (html == null) html = ''; would be better...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ibolmo
MooTools member
ibolmo commented Jan 7, 2012

👍 I'll manually update the check.

@ibolmo ibolmo merged commit 4086f20 into mootools:master Jan 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.