[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 02/04: AJoute fonction waiting_node & create_
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 02/04: AJoute fonction waiting_node & create_div |
Date: |
Sun, 24 May 2015 18:12:01 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit a7138053823d90e5bd53f4e61aa8af8e88bd9685
Author: Dany De Bontridder <address@hidden>
Date: Sun May 24 19:59:14 2015 +0200
AJoute fonction waiting_node & create_div
---
html/js/scripts.js | 63 ++++++++++++++++++++++++++++++++++++++++-----------
1 files changed, 49 insertions(+), 14 deletions(-)
diff --git a/html/js/scripts.js b/html/js/scripts.js
index ecb9cbc..ac19a93 100644
--- a/html/js/scripts.js
+++ b/html/js/scripts.js
@@ -599,26 +599,28 @@ function set_wait_obsolete(name)
$(content).innerHTML = 'Un instant...<image src="image/loading.gif"
border="0" alt="Chargement...">';
}
/**
- address@hidden add dynamically a object for AJAX
- address@hidden obj.
- * the attributes are
+ * Create a div without showing it
+ * @param {type} obj
+ * the attributes are
* - style to add style
* - id to add an id
* - cssclass to add a class
* - html is the content
* - drag is the div can be moved
+ * @returns html dom element
+ * @see add_div
*/
-function add_div(obj)
+function create_div(obj)
{
try
{
var top = document;
-
+ var elt = null;
if (!$(obj.id)) {
- var elt = top.createElement('div');
+ elt = top.createElement('div');
}
else {
- var elt = $(obj.id);
+ elt = $(obj.id);
}
if (obj.id)
{
@@ -637,7 +639,7 @@ function add_div(obj)
}
if (obj.cssclass)
{
- elt.setAttribute('class', obj.cssclass);/* FF */
+ elt.setAttribute('class', obj.cssclass); /* FF */
elt.setAttribute('className', obj.cssclass); /* IE */
}
if (obj.html)
@@ -646,7 +648,9 @@ function add_div(obj)
}
var bottom_div = document.body;
+ elt.hide();
bottom_div.appendChild(elt);
+
/* if ( obj.effect && obj.effect != 'none' ) {
Effect.Grow(obj.id,{direction:'top-right',duration:0.1}); }
else if ( ! obj.effect ){
Effect.Grow(obj.id,{direction:'top-right',duration:0.1}); }*/
if (obj.drag)
@@ -657,8 +661,30 @@ function add_div(obj)
}}
);
}
+ return elt;
+ }
+ catch (e)
+ {
+ error_message("create_div " + e.message);
+ }
+}
+/**
+ address@hidden add dynamically a object for AJAX
+ address@hidden obj.
+ * the attributes are
+ * - style to add style
+ * - id to add an id
+ * - cssclass to add a class
+ * - html is the content
+ * - drag is the div can be moved
+ */
+function add_div(obj)
+{
+ try {
+ var elt=create_div(obj);
/* elt.setStyle({visibility:'visible'}); */
- elt.style.visibility='visible';
+ elt.style.visibility = 'visible';
+ elt.show();
}
catch (e)
{
@@ -683,6 +709,11 @@ function removeDiv(elt)
window.location.reload();
}
}
+function waiting_node()
+{
+ $('info_div').innerHTML = 'Un instant';
+ $('info_div').style.display = "block";
+}
/**
*show a box while loading
*must be remove when ajax is successfull
@@ -698,8 +729,7 @@ function waiting_box()
if ($('wait_box')) {
removeDiv('wait_box');
}
- $('info_div').innerHTML = 'Un instant';
- $('info_div').style.display = "block";
+ waiting_node();
add_div(obj);
$('wait_box').setOpacity(0.7);
@@ -1227,7 +1257,7 @@ function search_reconcile(dossier, ctl_concern,
amount_id, ledger, p_id_target)
str_style += ";width:92%;overflow:auto;";
waiting_box();
-
+
var target = {gDossier: dossier,
ctlc: ctl_concern,
op: 'search_op',
@@ -1325,11 +1355,16 @@ function set_reconcile(obj)
alert(e.message)
}
}
-function remove_waiting_box()
+function remove_waiting_node()
{
- removeDiv('wait_box');
$('info_div').innerHTML = "";
$('info_div').style.display = "none";
+
+}
+function remove_waiting_box()
+{
+ removeDiv('wait_box');
+ remove_waiting_node();
}
function get_profile_detail(gDossier, profile_id)
{