UI Callback Events
UI Callback Events
Paul,
A couple quick event questions this morning.
1. droppable.drop callback is getting undefined for ev param. Would mouseup ev make sense here? It would seem to fit our intention of providing ev (testing for button, control keys, etc.)
2. I got a question in #jquery-ui about how to test whether something is resizable in order to turn on/off resizability (for example, only allow resizing if it has already been clicked on). A couple thoughts/options:
2.1 Query whether an object is resizable:
a) Add .ui-resizable css class to resizable object on creation
b) Expose resizable collection (and other UI manager collections) in documented API for search/query.
c) Use ui.add and ui.get? This seems to be the closest current way, but doesn't work for (as easily) for an arbitrary element (one you didn't call add() and keep a name for).
2.2 Destroy a resizable:
a)
ui.remove to match ui.add? ui.destroy?
b) re-call .resizable, but pass null for options? This would also allow for options to be changed/added (if not null). An options map could be saved and toggle could pass the options map and null.
2.3 Prevent resizing of a resizable:
a) Add an option called 'allow' or 'active' that would be a custom boolean function for whether resizing should happen. Default: return true;
b) Allow for something like
resizable.resize() { if (!isActive) return false; }. Maybe this would make more sense on .start? Both?
- Richard