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

How can i destroy an created instance #75

Open
fatihkutuk opened this issue Dec 8, 2022 · 1 comment
Open

How can i destroy an created instance #75

fatihkutuk opened this issue Dec 8, 2022 · 1 comment

Comments

@fatihkutuk
Copy link

fatihkutuk commented Dec 8, 2022

iam trying this

  var myInstance= subjx("myselector").drag(svgOptions);

its working like that its okey

img

but when i try

  myInstance.disable()

then it give this error => myInstance.disable is not a function

@sysmaya
Copy link

sysmaya commented Dec 8, 2022

HI, To disable the selector I created this function.

function HideSelector(){ if(xDraggable!=null) xDraggable.disable(); [...document.querySelectorAll( 'g.sjx-svg-wrapper' )].forEach((element, index, array) => { element.remove(); }); }

And when I want to activate the selector, the first thing is to add the ".selected" class to the selected objects.
And to activate the selector I call the function makeSelection()

`function makeSelection( ){
HideSelector();

const _SXparams = { rotatorAnchor:'n', rotatorOffset:5  }; 
xElem = subjx( '.selectable' );
xDraggable=xElem.drag(_SXparams);

} `

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

2 participants