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

AMD don't list dependency on jQuery UI #695

Closed
crystalfp opened this issue Feb 24, 2017 · 1 comment
Closed

AMD don't list dependency on jQuery UI #695

crystalfp opened this issue Feb 24, 2017 · 1 comment

Comments

@crystalfp
Copy link

My application relies on AMD and already loads jquery and jquery-ui modules. Now I'm trying to add fancytree. But loading fancytree-all.min.js raises the "Fancytree requires jQuery UI (http://jqueryui.com)" assertion.
The only solution found is to add a RequireJS shim to add the dependency:

requirejs.config({
	paths: {
		"jquery": "jquery-3.1.1.min",
		"jquery-ui": "jquery-ui.min",
		"jquery-fancytree": "jquery.fancytree-all.min"
	},
	shim: {
		"jquery-fancytree": {
			deps: ["jquery-ui"]
		}
	}
});

Seems the AMD support should be corrected to add all required libraries.
Thanks for looking!
mario

@mar10 mar10 added the bug label Feb 26, 2017
@mar10
Copy link
Owner

mar10 commented May 29, 2017

Could you test if this header would work for you:

(function( factory ) {
	if ( typeof define === "function" && define.amd ) {
		define( [
			"jquery",
			"jquery-ui/ui/widgets/mouse",
			"jquery-ui/ui/widgets/draggable",
			"jquery-ui/ui/widgets/droppable",
			"jquery-ui/ui/effects/effect-blind",
			"jquery-ui/ui/data",
			"jquery-ui/ui/effect",
			"jquery-ui/ui/focusable",
			"jquery-ui/ui/keycode",
			"jquery-ui/ui/position",
			"jquery-ui/ui/scroll-parent",
			"jquery-ui/ui/tabbable",
			"jquery-ui/ui/unique-id",
			"jquery-ui/ui/widget"
		], factory );
	} else {
		factory( jQuery );
	}
}(function( $ ) {

(See also related #694 for use cases where jQuery UI is required for Fancytree only.)

@mar10 mar10 added the waiting label May 29, 2017
@mar10 mar10 closed this as completed in e234f68 Jun 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants