edit.js update
This is jquery only update Add new overlay and action indicator for auto any overlay boxes. Stack with GS_OB_S and min zIndex layer 10 and raise +1 for each new show overlay call and lower for each hide call
This commit is contained in:
2
4dev/database/log/.gitignore
vendored
Normal file
2
4dev/database/log/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
||||||
@@ -382,7 +382,7 @@ input[type="text"]:focus, textarea:focus, select:focus {
|
|||||||
left: 0;
|
left: 0;
|
||||||
top: 0;
|
top: 0;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
z-index: 100;
|
z-index: 1000;
|
||||||
}
|
}
|
||||||
/* Animation for above progress */
|
/* Animation for above progress */
|
||||||
@keyframes rotate {
|
@keyframes rotate {
|
||||||
|
|||||||
@@ -12,6 +12,10 @@ if (!DEBUG) {
|
|||||||
});
|
});
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
// open overlay boxes counter
|
||||||
|
var GL_OB_S = 10;
|
||||||
|
var GL_OB_BASE = 10;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* opens a popup window with winName and given features (string)
|
* opens a popup window with winName and given features (string)
|
||||||
* @param {String} theURL the url
|
* @param {String} theURL the url
|
||||||
@@ -393,6 +397,20 @@ function errorCatch(err)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************
|
||||||
|
* OLD action indicator and overlay boxes calls
|
||||||
|
* DO NOT USE
|
||||||
|
* actionIndicator -> showActionIndicator
|
||||||
|
* actionIndicator -> hideActionIndicator
|
||||||
|
* actionIndicatorShow -> showActionIndicator
|
||||||
|
* actionIndicatorHide -> hideActionIndicator
|
||||||
|
* overlayBoxShow -> showOverlayBoxLayers
|
||||||
|
* overlayBoxHide -> hideOverlayBoxLayers
|
||||||
|
* setOverlayBox -> showOverlayBoxLayers
|
||||||
|
* hideOverlayBox -> hideOverlayBoxLayers
|
||||||
|
* ClearCall -> ClearCallActionBox
|
||||||
|
* ***********************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* show or hide the "do" overlay
|
* show or hide the "do" overlay
|
||||||
* @param {String} loc location name for action indicator
|
* @param {String} loc location name for action indicator
|
||||||
@@ -401,10 +419,10 @@ function errorCatch(err)
|
|||||||
*/
|
*/
|
||||||
function actionIndicator(loc, overlay = true)
|
function actionIndicator(loc, overlay = true)
|
||||||
{
|
{
|
||||||
if ($('#overlayBox').is(':visible')) {
|
if ($('#indicator').is(':visible')) {
|
||||||
actionIndicatorHide(loc, overlay);
|
actionIndicatorHide(loc, overlay);
|
||||||
} else {
|
} else {
|
||||||
actionIndicatorShow(loc, overlay);
|
actionIndicatorShow(loc, overlay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -455,6 +473,7 @@ function overlayBoxShow()
|
|||||||
$('#overlayBox').css('zIndex', '100');
|
$('#overlayBox').css('zIndex', '100');
|
||||||
} else {
|
} else {
|
||||||
$('#overlayBox').show();
|
$('#overlayBox').show();
|
||||||
|
$('#overlayBox').css('zIndex', '98');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -464,7 +483,7 @@ function overlayBoxShow()
|
|||||||
function overlayBoxHide()
|
function overlayBoxHide()
|
||||||
{
|
{
|
||||||
// if the overlay box z-index is 100, do no hide, but set to 98
|
// if the overlay box z-index is 100, do no hide, but set to 98
|
||||||
if ($('#overlayBox').css('zIndex') == 100) {
|
if ($('#overlayBox').css('zIndex') >= 100) {
|
||||||
$('#overlayBox').css('zIndex', '98');
|
$('#overlayBox').css('zIndex', '98');
|
||||||
} else {
|
} else {
|
||||||
$('#overlayBox').hide();
|
$('#overlayBox').hide();
|
||||||
@@ -501,6 +520,153 @@ function ClearCall()
|
|||||||
$('#overlayBox').hide();
|
$('#overlayBox').hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*************************************************************
|
||||||
|
* NEW action indicator and overlay box calls
|
||||||
|
* USE THIS
|
||||||
|
* ***********************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* show action indicator
|
||||||
|
* - checks if not existing and add
|
||||||
|
* - only shows if not visible (else ignore)
|
||||||
|
* - overlaybox check is called and shown on a fixzed
|
||||||
|
* zIndex of 1000
|
||||||
|
* - indicator is page centered
|
||||||
|
* @param {String} loc ID string, only used for console log
|
||||||
|
*/
|
||||||
|
function showActionIndicator(loc)
|
||||||
|
{
|
||||||
|
console.log('Indicator: SHOW [%s]', loc);
|
||||||
|
// check if indicator element exists
|
||||||
|
if ($('#indicator').length == 0) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.className = 'progress hide';
|
||||||
|
el.id = 'indicator';
|
||||||
|
$('body').append(el);
|
||||||
|
}
|
||||||
|
// indicator not visible
|
||||||
|
if (!$('#indicator').is(':visible')) {
|
||||||
|
// check if overlay box element exits
|
||||||
|
checkOverlayExists();
|
||||||
|
// if not visible show
|
||||||
|
if (!$('#overlayBox').is(':visible')) {
|
||||||
|
$('#overlayBox').show();
|
||||||
|
}
|
||||||
|
// always set to 1000 zIndex to be top
|
||||||
|
$('#overlayBox').css('zIndex', 1000);
|
||||||
|
// show indicator
|
||||||
|
$('#indicator').show();
|
||||||
|
// center it
|
||||||
|
setCenter('indicator', true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hide action indicator, if it is visiable
|
||||||
|
* If the global variable GL_OB_S is > 10 then
|
||||||
|
* the overlayBox is not hidden but the zIndex
|
||||||
|
* is set to this value
|
||||||
|
* @param {String} loc ID string, only used for console log
|
||||||
|
*/
|
||||||
|
function hideActionIndicator(loc)
|
||||||
|
{
|
||||||
|
console.log('Indicator: HIDE [%s]', loc);
|
||||||
|
// check if indicator is visible
|
||||||
|
if ($('#indicator').is(':visible')) {
|
||||||
|
// hide indicator
|
||||||
|
$('#indicator').hide();
|
||||||
|
// if global overlay box count is > 0
|
||||||
|
// then set it to this level and keep
|
||||||
|
if (GL_OB_S > GL_OB_BASE) {
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_S);
|
||||||
|
} else {
|
||||||
|
// else hide overlay box and set zIndex to 0
|
||||||
|
$('#overlayBox').hide();
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_BASE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* checks if overlayBox exists, if not it is
|
||||||
|
* added as hidden item at the body end
|
||||||
|
*/
|
||||||
|
function checkOverlayExists()
|
||||||
|
{
|
||||||
|
// check if overlay box exists, if not create it
|
||||||
|
if ($('#overlayBox').length == 0) {
|
||||||
|
var el = document.createElement('div');
|
||||||
|
el.className = 'overlayBoxElement hide';
|
||||||
|
el.id = 'overlayBox';
|
||||||
|
$('body').append(el);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* show overlay box
|
||||||
|
* if not visible show and set zIndex to 10 (GL_OB_BASE)
|
||||||
|
* if visible, add +1 to the GL_OB_S variable and
|
||||||
|
* up zIndex by this value
|
||||||
|
*/
|
||||||
|
function showOverlayBoxLayers(el_id)
|
||||||
|
{
|
||||||
|
console.log('SHOW overlaybox: %s', GL_OB_S);
|
||||||
|
// if overlay box is not visible show and set zIndex to 0
|
||||||
|
if (!$('#overlayBox').is(':visible')) {
|
||||||
|
$('#overlayBox').show();
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_BASE);
|
||||||
|
// also set start variable to 0
|
||||||
|
GL_OB_S = GL_OB_BASE;
|
||||||
|
}
|
||||||
|
// up the overlay box counter by 1
|
||||||
|
GL_OB_S ++;
|
||||||
|
// set zIndex
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_S);
|
||||||
|
// if element given raise zIndex and show
|
||||||
|
if (el_id) {
|
||||||
|
if ($('#' + el_id).length > 0) {
|
||||||
|
$('#' + el_id).css('zIndex', GL_OB_S + 1);
|
||||||
|
$('#' + el_id).show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
console.log('SHOW overlaybox NEW zIndex: %s', $('#overlayBox').css('zIndex'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hide overlay box
|
||||||
|
* lower GL_OB_S value by -1
|
||||||
|
* if we are 10 (GL_OB_BASE) or below hide the overlayIndex
|
||||||
|
* and set zIndex and GL_OB_S to 0
|
||||||
|
* else just set zIndex to the new GL_OB_S value
|
||||||
|
*/
|
||||||
|
function hideOverlayBoxLayers()
|
||||||
|
{
|
||||||
|
console.log('HIDE overlaybox: %s', GL_OB_S);
|
||||||
|
// remove on layer
|
||||||
|
GL_OB_S --;
|
||||||
|
// if 0 or lower (overflow) hide it and
|
||||||
|
// set zIndex to 0
|
||||||
|
if (GL_OB_S <= GL_OB_BASE) {
|
||||||
|
GL_OB_S = GL_OB_BASE;
|
||||||
|
$('#overlayBox').hide();
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_BASE);
|
||||||
|
} else {
|
||||||
|
// if OB_S > 0 then set new zIndex
|
||||||
|
$('#overlayBox').css('zIndex', GL_OB_S);
|
||||||
|
}
|
||||||
|
console.log('HIDE overlaybox NEW zIndex: %s', $('#overlayBox').css('zIndex'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* only for single action box
|
||||||
|
*/
|
||||||
|
function clearCallActionBox()
|
||||||
|
{
|
||||||
|
$('#actionBox').html('');
|
||||||
|
$('#actionBox').hide();
|
||||||
|
hideOverlayBoxLayers();
|
||||||
|
}
|
||||||
|
|
||||||
// *** DOM MANAGEMENT FUNCTIONS
|
// *** DOM MANAGEMENT FUNCTIONS
|
||||||
/**
|
/**
|
||||||
* reates object for DOM element creation flow
|
* reates object for DOM element creation flow
|
||||||
|
|||||||
@@ -829,7 +829,7 @@ class Generate extends \CoreLibs\DB\Extended\ArrayIO
|
|||||||
$data['checked'] = 0;
|
$data['checked'] = 0;
|
||||||
for ($i = (count($this->table_array[$element_name]['element_list']) - 1); $i >= 0; $i --) {
|
for ($i = (count($this->table_array[$element_name]['element_list']) - 1); $i >= 0; $i --) {
|
||||||
$data['value'][] = $i;
|
$data['value'][] = $i;
|
||||||
$data['output'][] = $this->table_array[$element_name]['element_list'][$i];
|
$data['output'][] = $this->table_array[$element_name]['element_list'][$i] ?? null;
|
||||||
$data['name'] = $element_name;
|
$data['name'] = $element_name;
|
||||||
if (isset($this->table_array[$element_name]['value']) &&
|
if (isset($this->table_array[$element_name]['value']) &&
|
||||||
(($i && $this->table_array[$element_name]['value']) ||
|
(($i && $this->table_array[$element_name]['value']) ||
|
||||||
|
|||||||
Reference in New Issue
Block a user