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

JQuery UI definitions file problems, and in general lack of test for definitions files #21

Closed
fdecampredon opened this issue Oct 26, 2012 · 4 comments

Comments

@fdecampredon
Copy link
Contributor

I noticed some problems in your JQueryUI defintion, especialy the way you declare events. They should not be a method, but a property function.
For example in the Widget interface :

create(event: Event, ui): void;
should be in fact
create:(event: Event, ui)=> void;

Plus a lot of properties should be marked as optional etc.

In general we should find a way yo automate tests on lib files so we can be sure they perfectly match the true library, because at the moment i'm pretty sure none of the files presents in this repository are exacts.

@borisyankov
Copy link
Member

The tests, usually taken from the official docs work very very well.
jQuery UI is more a work of progress yet. Just a lot to be done.

@rekna1
Copy link

rekna1 commented Oct 30, 2012

I have a problem with e.g. Tabs interface :

$("#temp").tabs({activate:1});

gives me an error : supplied parameters do not match any signature

events should be marked with a question mark.

I don't think methods belong on the interface...
you call them like this:
$("#temp").tabs("disable")

or am I missing something ?

@borisyankov
Copy link
Member

I added the needed method definitions and took the options to a separate interface.
The definitions work now. Will add more tests and improve the definitions in the next few days.

@rekna1
Copy link

rekna1 commented Oct 30, 2012

This still needs improvement. Events like activate should go on the option interface, because they can be specified (and they most likely are) when creating the widget (from the viewpoint of someone using the widget).

$("#temp").tabs({activate:function(event,ui) { alert("a tab is activated"); });

should be possible.

They should also be marked with a question mark, as events are in most cases optional.

I don't know if events are needed on the specific widget interface, maybe someone who wants to subclass a specific widget? Maybe they are not needed at all

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

No branches or pull requests

3 participants