Remove duplicate code

This commit is contained in:
rishabjasrotia
2023-11-16 20:14:32 +05:30
parent 876a2d78d5
commit b8e8cd127a
3 changed files with 15 additions and 24 deletions
@@ -1,4 +1,5 @@
import axios from "axios";
import { $ } from 'select-dom';
export async function getBase64FromUrl(url) {
const data = await fetch(url);
@@ -57,7 +58,7 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) {
(data, ind) =>
data.key === signKey && data.Width && data.Height && data.SignUrl
);
if (updateFilter.length > 0) {
let newWidth, newHeight;
@@ -260,3 +261,14 @@ export const contactBookName = async (objectId, className) => {
});
return result;
};
export const modalAlign = () => {
let modalDialog = $('.modal-dialog').getBoundingClientRect();
let mobileHead = $('.mobileHead').getBoundingClientRect()
let modal = $('.modal-dialog');
if (modalDialog.left < mobileHead.left) {
let leftOffset = mobileHead.left - modalDialog.left;
modal.style.left = leftOffset + 'px';
modal.style.top = (window.innerHeight/3) + 'px';
}
};