Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Slick.getAttribute, expose Slick.hasAttribute so it can be used as MooTools getProperty #45

Merged
merged 1 commit into from
Aug 12, 2011

Conversation

arian
Copy link
Member

@arian arian commented Aug 12, 2011

Add maxLength to attributes. Expose Slick.hasAttribute and makes sure the document is set when using Slick.getAttribute

@cpojer
Copy link
Member

cpojer commented Aug 12, 2011

This is sweet. @subtleGradient what do you say?

@arian
Copy link
Member Author

arian commented Aug 12, 2011

As shown here, http://jsfiddle.net/arian/Hd3hd/, leaving local.setDocument was a bug.

@@ -185,12 +185,12 @@ local.setDocument = function(document){
// getAttribute

features.getAttribute = (features.isHTMLDocument && brokenFormAttributeGetter) ? function(node, name){
var method = this.attributeGetters[name];
var method = this.attributeGetters[name.toLowerCase()];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a performance issue.
If you need this, add it to the code that calls this method.

@subtleGradient
Copy link
Member

Looks good. All except the toLowerCase.
Remove that and I'll merge.

@subtleGradient
Copy link
Member

Alternatively you could add all the various cases to the object as references to the same getter.
e.g. attributeGetters.MAXLENGTH = attributeGetters.maxLength = attributeGetters.maxlength

@arian
Copy link
Member Author

arian commented Aug 12, 2011

ah, yeah good idea, will fix it in a minute!

… the document is set when using Slick.getAttribute
@arian
Copy link
Member Author

arian commented Aug 12, 2011

@subtleGradient merge it :)

subtleGradient added a commit that referenced this pull request Aug 12, 2011
Fix Slick.getAttribute, expose Slick.hasAttribute so it can be used as MooTools getProperty
@subtleGradient subtleGradient merged commit ae7e75c into mootools:master Aug 12, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants