diff --git a/4dev/database/table/generic.sql b/4dev/database/table/generic.sql index cab8ac11..c8a72d2b 100644 --- a/4dev/database/table/generic.sql +++ b/4dev/database/table/generic.sql @@ -9,5 +9,6 @@ CREATE TABLE generic ( date_created TIMESTAMP WITHOUT TIME ZONE DEFAULT clock_timestamp(), date_updated TIMESTAMP WITHOUT TIME ZONE, + uuid UUID DEFAULT gen_random_uuid(), uid VARCHAR ); diff --git a/www/admin/layout/javascript/edit.jq.js b/www/admin/layout/javascript/edit.jq.js index dba5f852..2e33f2e5 100644 --- a/www/admin/layout/javascript/edit.jq.js +++ b/www/admin/layout/javascript/edit.jq.js @@ -134,8 +134,8 @@ function setCenter(id, left, top) { // get size of id var dimensions = { - height: $('#' + id).height(), - width: $('#' + id).width() + height: $('#' + id).height() ?? 0, + width: $('#' + id).width() ?? 0 }; var type = $('#' + id).css('position'); var viewport = getWindowSize(); @@ -146,14 +146,14 @@ function setCenter(id, left, top) // console.log('Left: %s, Top: %s (%s)', parseInt((viewport.width / 2) - (dimensions.width / 2) + offset.left), parseInt((viewport.height / 2) - (dimensions.height / 2) + offset.top), parseInt((viewport.height / 2) - (dimensions.height / 2))); if (left) { $('#' + id).css({ - left: parseInt((viewport.width / 2) - (dimensions.width / 2) + offset.left) + 'px' + left: ((viewport.width / 2) - (dimensions.width / 2) + offset.left) + 'px' }); } if (top) { // if we have fixed, we do not add the offset, else it moves out of the screen var top_pos = type == 'fixed' ? - parseInt((viewport.height / 2) - (dimensions.height / 2)) : - parseInt((viewport.height / 2) - (dimensions.height / 2) + offset.top); + (viewport.height / 2) - (dimensions.height / 2) : + (viewport.height / 2) - (dimensions.height / 2) + offset.top; $('#' + id).css({ top: top_pos + 'px' });