Skip to content

jquery-ui directories wrong in gridstack.js #513

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

Closed
starplanet opened this issue Aug 18, 2016 · 4 comments
Closed

jquery-ui directories wrong in gridstack.js #513

starplanet opened this issue Aug 18, 2016 · 4 comments

Comments

@starplanet
Copy link

In jquery-ui 1.12.0, all associate files are moved to ui directory not in root directory. So the following code in gridstack.js is deprecated.

if (typeof define === 'function' && define.amd) {
define(['jquery', 'lodash', 'jquery-ui/data', 'jquery-ui/disable-selection', 'jquery-ui/focusable',
'jquery-ui/form', 'jquery-ui/ie', 'jquery-ui/keycode', 'jquery-ui/labels', 'jquery-ui/jquery-1-7',
'jquery-ui/plugin', 'jquery-ui/safe-active-element', 'jquery-ui/safe-blur', 'jquery-ui/scroll-parent',
'jquery-ui/tabbable', 'jquery-ui/unique-id', 'jquery-ui/version', 'jquery-ui/widget',
'jquery-ui/widgets/mouse', 'jquery-ui/widgets/draggable', 'jquery-ui/widgets/droppable',
'jquery-ui/widgets/resizable'], factory);

It's recommended to use define(['jquery', 'lodash', 'jquery-ui']) to substitute.

@radiolips
Copy link
Member

jquery-ui files were in /ui in v.1.11 for jquery-ui installed via bower. By not defining the exact location for jquery-ui in gridstack, we have actually enabled the user to have control.

Your main.js file may look something like this:

require.config({
    paths: {
        'jquery-ui': 'vendor/jquery-ui/ui/'
...

Based on jqui's own page (https://learn.jquery.com/jquery-ui/environments/amd/), this seems like the most suitable solution. If they have updated recommended settings, we are open to changing it, but for now this method continues to suffice for now. I do believe we will update this as more libraries update dependency to newer jqui.

@starplanet
Copy link
Author

Ok. I get it. Thanks.

原始邮件
发件人:[email protected]
收件人:troolee/[email protected]
抄送:[email protected]; [email protected]
发送时间:2016年8月19日(周五) 04:38
主题:Re: [troolee/gridstack.js] jquery-ui directories wrong ingridstack.js (#513)

jquery-ui files were in /ui in v.1.11 for jquery-ui installed via bower. By not defining the exact location for jquery-ui in gridstack, we have actually enabled the user to have control.
Your main.js file may look something like this:
require.config({ paths: { 'jquery-ui': 'vendor/jquery-ui/ui/' ...
Based on jqui's own page (https://learn.jquery.com/jquery-ui/environments/amd/), this seems like the most suitable solution. If they have updated recommended settings, we are open to changing it, but for now this method continues to suffice for now. I do believe we will update this as more libraries update dependency to newer jqui.

You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@arch-imp
Copy link

I believe jquery-ui has updated their advice and now recommends the paths in gridstack.jQueryUI.js be changed to include the 'ui' folder.

See the jquery ui 1.12 upgrade guide where they state:

When you're ready to upgrade, you need to update your import paths.

Before:

var autocomplete = require( "jquery-ui/autocomplete" );
After:

var autocomplete = require( "jquery-ui/ui/widgets/autocomplete" );

I tried adding the path alias in my Angular 2 CLI project tsconfig.app.json file, but the angular compiler would then hang:
"baseUrl": "",
"paths":{
"jquery-ui/":["jquery-ui/ui/"]
}

I'm guessing it goes into an infinite recursion loop trying to resolve "jquery-ui". Perhaps there is a better way to add the alias to an Angular 2 CLI project?

@creage
Copy link

creage commented Sep 11, 2017

Redefining alias affects other jQueryUI plugins which are used in the project, if any, which is not acceptable.

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

4 participants