[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 26/73: Cosmetic : select_box for javascript ,
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 26/73: Cosmetic : select_box for javascript , display the selected option |
Date: |
Fri, 28 May 2021 05:26:27 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 05da3e2791a5cae4a4c91942f327919247956d48
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Apr 18 12:13:08 2021 +0200
Cosmetic : select_box for javascript , display the selected option
---
include/lib/select_box.class.php | 15 +++++++++++----
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/include/lib/select_box.class.php b/include/lib/select_box.class.php
index d3a0088..2527734 100644
--- a/include/lib/select_box.class.php
+++ b/include/lib/select_box.class.php
@@ -134,7 +134,7 @@ class Select_Box
$javascript=$this->compute_position();
// display the button
- printf('<input type="button" class="smallbutton " id="%s_bt" value="%s
▾" >',
+ printf('<input type="button" class="smallbutton " id="%s_bt" value="%s
⇩" >',
$this->id, $this->value);
printf('<input type="hidden" id="%s" name="%s" value="%s">',
$this->id, $this->id, $this->default_value);
@@ -194,10 +194,17 @@ class Select_Box
$this->cnt++;
}
- function add_javascript($label, $javascript)
+ function add_javascript($label, $javascript,$replace=false)
{
$this->item[$this->cnt]['label']=$label;
-
$this->item[$this->cnt]['javascript']=$javascript.";$('select_box{$this->id}').hide()";
+ if ( $replace )
+ {
+ $this->item[$this->cnt]['javascript']=
+ sprintf("$('%s_bt').value='%s
\u21E9';",$this->id,str_replace("'","",$label)).
+ $javascript.";$('select_box{$this->id}').hide()";
+ } else {
+
$this->item[$this->cnt]['javascript']=$javascript.";$('select_box{$this->id}').hide()";
+ }
$this->item[$this->cnt]['type']="javascript";
$this->cnt++;
}
@@ -206,7 +213,7 @@ class Select_Box
{
$this->item[$this->cnt]['label']=$label;
$this->item[$this->cnt]['update']=$value;
- $this->item[$this->cnt]['javascript']=sprintf("
$('%s').value='%s';$('%s_bt').value='%s';$('select_box%s').hide()",
+ $this->item[$this->cnt]['javascript']=sprintf("
$('%s').value='%s';$('%s_bt').value='%s \u21E9';$('select_box%s').hide()",
$this->id, $value, $this->id, $label, $this->id);
$this->item[$this->cnt]['type']='value';
$this->cnt++;
- [Noalyss-commit] [noalyss] 31/73: Task #0001961: Devise, cosmetic align number, (continued)
- [Noalyss-commit] [noalyss] 31/73: Task #0001961: Devise, cosmetic align number, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 33/73: CURRENCY : conversion problem, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 32/73: Fix bug Forecast, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 15/73: Cosmetic and small bugs, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 17/73: Cosmetic :, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 14/73: Cosmetic bg color tabs, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 42/73: Cosmetic : position of "invoice, template , ..." after saving an operation, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 43/73: Improve Manage_Table : align column numeric to the right by default, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 18/73: Direct Access with a Single AC (without the full path), Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 30/73: Historic : search on currency, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 26/73: Cosmetic : select_box for javascript , display the selected option,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 25/73: Cosmetic : icon in dialog box, lightblue when hover, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 46/73: Improve Sort Table ,, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 27/73: Javascript : waiting box display when exporting in PDF or CSV, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 37/73: Cosmetic improve smoke dg box, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 39/73: Bug #0001971: erreur calcul dans champ prix/unité htva, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 06/73: Cosmetic, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 08/73: Warning if PHPVERSION < 7.2, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 10/73: Cosmetic : update fontello, button inplace_edit, doc, logo and dashboad, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 16/73: Currency : add a check , upgrade version of DB, Dany De Bontridder, 2021/05/28
- [Noalyss-commit] [noalyss] 24/73: Bug Select_Box = problem with DIV id, Dany De Bontridder, 2021/05/28