Skip to content

Commit

Permalink
Merge release/0.2.13
Browse files Browse the repository at this point in the history
  • Loading branch information
nassim gadacha committed Dec 7, 2023
2 parents c5b849c + 9036007 commit 2a621f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='django-subject-imagefield',
version='0.2.12',
version='0.2.13',
packages=['subject_imagefield'],
include_package_data=True,
license='MIT License',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
// get real size
var position = updateInputPosition();
var initPinPosition = toEdgeCoordinates(percToPreviewCoordinates(position));

if (!PIN) PIN = $('<div />')
PIN.css({
background: 'black',
Expand All @@ -99,8 +98,15 @@
};
image.onload = updatePinPosition;
image.src = '{{ widget.value.url }}';
$(image).resize(updatePinPosition);
window.addEventListener('hashchange', updatePinPosition);
var foo = document.getElementById("subject-image-preview-{{ widget.attrs.id }}");
if (foo) {
var observer = new ResizeObserver(function(entries) {
entries.forEach(function(entry) {
updatePinPosition()
});
});
observer.observe(foo);
}
}

$(document).ready(function () {
Expand Down

0 comments on commit 2a621f8

Please sign in to comment.