general SQL update to use uuid for uid, update edit.jq.js for some testing
This commit is contained in:
@@ -9,5 +9,6 @@
|
|||||||
CREATE TABLE generic (
|
CREATE TABLE generic (
|
||||||
date_created TIMESTAMP WITHOUT TIME ZONE DEFAULT clock_timestamp(),
|
date_created TIMESTAMP WITHOUT TIME ZONE DEFAULT clock_timestamp(),
|
||||||
date_updated TIMESTAMP WITHOUT TIME ZONE,
|
date_updated TIMESTAMP WITHOUT TIME ZONE,
|
||||||
|
uuid UUID DEFAULT gen_random_uuid(),
|
||||||
uid VARCHAR
|
uid VARCHAR
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -134,8 +134,8 @@ function setCenter(id, left, top)
|
|||||||
{
|
{
|
||||||
// get size of id
|
// get size of id
|
||||||
var dimensions = {
|
var dimensions = {
|
||||||
height: $('#' + id).height(),
|
height: $('#' + id).height() ?? 0,
|
||||||
width: $('#' + id).width()
|
width: $('#' + id).width() ?? 0
|
||||||
};
|
};
|
||||||
var type = $('#' + id).css('position');
|
var type = $('#' + id).css('position');
|
||||||
var viewport = getWindowSize();
|
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)));
|
// 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) {
|
if (left) {
|
||||||
$('#' + id).css({
|
$('#' + 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 (top) {
|
||||||
// if we have fixed, we do not add the offset, else it moves out of the screen
|
// if we have fixed, we do not add the offset, else it moves out of the screen
|
||||||
var top_pos = type == 'fixed' ?
|
var top_pos = type == 'fixed' ?
|
||||||
parseInt((viewport.height / 2) - (dimensions.height / 2)) :
|
(viewport.height / 2) - (dimensions.height / 2) :
|
||||||
parseInt((viewport.height / 2) - (dimensions.height / 2) + offset.top);
|
(viewport.height / 2) - (dimensions.height / 2) + offset.top;
|
||||||
$('#' + id).css({
|
$('#' + id).css({
|
||||||
top: top_pos + 'px'
|
top: top_pos + 'px'
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user