-
Notifications
You must be signed in to change notification settings - Fork 438
Only Start if not Disabled #2 #437
Only Start if not Disabled #2 #437
Conversation
…the disabled option is removed, ui sortable will launch.
Are the tests passing in your test environment? |
Found a workaround for the phantomJS issue.
|
Oh - they fail for me, too. I'm sorry, I should have checked. This is caused by calling element.sortable from within a callback function. Doing this works fine: But this way it can't be disabled first, and enabled after. Even though the problem is narrowed down this much, I'm not sure what it is. Usually problems like this arise from having the wrong context inside the function that is called. I tried calling it using element.sortable.call(context, opts) with various context but it seems to already have the correct one by default. Help very much appreciated. Thank you for taking the time! |
We should have this code as a function and invoke it right before the Thodoris Greasidis |
…art function is called.
sure, see if this is better. |
That's exactly what I meant, great!
|
I miss working in a team 8-) |
@michaschwab Earlier today I pushed some commits to v0.14 branch and the test are now passing. |
Merged in v0.14.x-dev branch with #444. |
Hi! Sorry for not getting back to you earlier. Thanks so much, it's almost perfect! For me, calling After making a slight alteration to the
Please let me know what you think, and if you can manage to put that in by tomorrow. I have a user study lined up tomorrow and having this then would mean a smoother experience. But I can hack it up for the demo if needed, so no pressure. Thanks again! |
I was thinking about adding such a check in the $watch. How about using the Thodoris Greasidis |
It seems that the related tests are failing either way. I will give it a try.Thodoris Greasidis |
At last! I managed to reproduce the infinite digest loop problem and
|
Just pushed some commits with fixes... Actually reverted the watchOnce Can you test it on your use case?Thodoris Greasidis |
Thanks so much for working so hard on this. It works!! Haven't tested extensively yet, but the delayed launch definitely works. Great work!! I'll do more testing later to see if anything else might be affected, but everything is looking perfect. |
Great! Nice to hear that. |
@michaschwab I just pushed some extra commits to the v0.14 branch. |
Thanks! Everything is looking great now. It's working well, including dragging across hierarchies, and only starts if not disabled. Perfect! 0.14 as stable sounds good to me. |
Ok great! Thanks for your contribution to this repo!
|
This is a follow up on this pull request: #436
This new pull request is based on the 0.14 branch. Also, I made the changes in the code more obvious and you can see that I barely changed anything in the diff below.
Find the description of the original pull request below:
Unfortunately, jquery ui sortable is very slow sometimes, specially if there are hidden elements as described here: http://stackoverflow.com/questions/9440664/jquery-ui-sortable-drag-initiation-is-slow-when-container-has-hidden-items
This adds up to more than 150ms for me on every user action, which is absolutely inacceptable, because I only need to use ui-sortable in very few cases. I need to be able to disable it.
Right now, it is not possible to hold off on launching ui sortable, similar to the problem discussed here: #397
Unfortunately, disabling jquery ui sortable only prevents the dragging from working, without actually not running. It still does all the expensive calls to the refreshPositions function.
All I need is to hold off before the start if the disabled option is set. My change is only about 7 lines - I wrapped the executed code into a "main" function, and only call that function if disabled is not set. The diff below is misleading.
I really hope this, or a different solution, can make it into the main rep. Thanks!