Skip to content

Update jquery.imgareaselect.dev.js#69

Open
eliyahen1 wants to merge 3 commits intoodyniec:masterfrom
eliyahen:patch-1
Open

Update jquery.imgareaselect.dev.js#69
eliyahen1 wants to merge 3 commits intoodyniec:masterfrom
eliyahen:patch-1

Conversation

@eliyahen1
Copy link

#39

It seems that the position of $outer parts are set to fixed when any of the IMG parents is fixed. This is true when you refer relatively to the body element.
But, if you set parent to an explicit element, and no fixed position is in between IMG element and parent element - the position of $outer should be 'absolute'.

Problem is, you determine and set the $outer position before you setSettings. So, the solution is to re-set it after you set options.

I ended up with this change:
In imgLoad function:
$box.add($outer).css({ visibility: '' , position: ($parent[0].tagName !== 'BODY'? 'absolute' : undefined) });

odyniec#39

It seems that the position of $outer parts are set to fixed when any of the IMG parents is fixed. This is true when you refer relatively to the body element.
But, if you set parent to an explicit element, and no fixed position is in between IMG element and parent element - the position of $outer should be 'absolute'.

Problem is, you determine and set the $outer position before you setSettings. So, the solution is to re-set it after you set options.

I ended up with this change:
In imgLoad function:
$box.add($outer).css({ visibility: '' , position: ($parent[0].tagName !== 'BODY'? 'absolute' : undefined) });
Bug Fixed: When minWidth / minHeight are greater than image size, the selection area is rendered out of the image.
Fix: Make sure the selection area is always inside the image boundaries (imageWidth & imageHeight must be defined).
Added options:
- disableCancelSelection: boolean (defaults: undefined/false), whether to disable cancel selection (selection is never hidden).
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