Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Oct 16, 2020

Description

Change to fix error mentioned in this thread: #858

Change to fix error mentioned in this thread: #858
Draggable/resizable should be initialized by this point anyways if you should be able to set options for them
el = $(el);
if (opts === 'disable' || opts === 'enable' || opts === 'destroy') {
el.resizable(opts);
el.resizable().resizable(opts);
Copy link
Member

Choose a reason for hiding this comment

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

thank you for the fix! but it has the side effect of enabling resizable before destroying it, which is wasteful if it wasn't created to start with. looking to see if we can avoid this...

@adumesny
Copy link
Member

actually you are looking at an old code base... in 2.0 (typescript) you can see in https://github.com/gridstack/gridstack.js/blob/develop/src/jq/gridstack-dd-jqueryui.ts#L32
that we now have

    } else if (opts === 'destroy') {
      if ($el.data('ui-draggable')) { // error to call destroy if not there
        $el.draggable(opts);
      }

so no need for your fix.

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.

1 participant