You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually thinking about this more it might be better to allow user to provide a function for the contain.onCollision option. I tried to replace popo.js in a project and it turned out to be a lot of work in the scenarios where popo's collision callback was used.
To provide more insight, this is the scenario I had:
popo($target[0],'get',{base: $item[0],position: 'right top right bottom',container: window,collision: function(pos,overlap){if(overlap.bottom<0){$target.addClass('reverse');}}});
Replicating this with current version of Mezr requires a lot more work.
The other collision actions are just a nice bonus after the callback function is implemented since you can pretty easily build any kind of collision handling behavior within the callback.
niklasramo
changed the title
Additional collision handler methods
Allow adjusting the final position of .place() method via callback
Nov 15, 2016
So after thinking about this more I think it's best to leave onCollision as it it and provide a new optional callback as an option, which is can be used to modify the return value of the method and which also receives all the available positioning data. This way user's can use the available collision methods and additionally modify the final result after collision correction.
The text was updated successfully, but these errors were encountered: