Inplace_Edit : cosmetic
This commit is contained in:
parent
8246933e92
commit
0187848d56
9 changed files with 107 additions and 7 deletions
|
|
@ -2247,4 +2247,18 @@ td.selectedmenu {
|
|||
background-color: #5D90CD;
|
||||
padding: 3px 20px 3px 20px;
|
||||
margin-top:20px;
|
||||
}
|
||||
/*
|
||||
* Style for the Inplace Edit element
|
||||
*/
|
||||
span.inplace_edit
|
||||
{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
span.inplace_edit_input
|
||||
{
|
||||
text-decoration: none;
|
||||
font-size: 110%;
|
||||
cursor: none;
|
||||
}
|
||||
|
|
@ -2162,4 +2162,18 @@ td.selectedmenu {
|
|||
#gestion_title {
|
||||
float:right;
|
||||
margin-right: 25px;
|
||||
}
|
||||
/*
|
||||
* Style for the Inplace Edit element
|
||||
*/
|
||||
span.inplace_edit
|
||||
{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
span.inplace_edit_input
|
||||
{
|
||||
text-decoration: none;
|
||||
font-size: 110%;
|
||||
cursor: none;
|
||||
}
|
||||
|
|
@ -2149,4 +2149,18 @@ td.selectedmenu {
|
|||
position:float;
|
||||
float:left;
|
||||
padding-left: 150px;
|
||||
}
|
||||
/*
|
||||
* Style for the Inplace Edit element
|
||||
*/
|
||||
span.inplace_edit
|
||||
{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
span.inplace_edit_input
|
||||
{
|
||||
text-decoration: none;
|
||||
font-size: 110%;
|
||||
cursor: none;
|
||||
}
|
||||
|
|
@ -1997,3 +1997,18 @@ button.cancel {
|
|||
text-decoration: none;
|
||||
color: black;
|
||||
}
|
||||
|
||||
/*
|
||||
* Style for the Inplace Edit element
|
||||
*/
|
||||
span.inplace_edit
|
||||
{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
span.inplace_edit_input
|
||||
{
|
||||
text-decoration: none;
|
||||
font-size: 110%;
|
||||
cursor: none;
|
||||
}
|
||||
|
|
@ -308,4 +308,15 @@ p#breakhere {page-break-before: always}
|
|||
}
|
||||
.tinybutton {
|
||||
display:none;
|
||||
}
|
||||
/*
|
||||
* Style for the Inplace Edit element
|
||||
*/
|
||||
span.inplace_edit
|
||||
{
|
||||
text-decoration: none;
|
||||
}
|
||||
span.inplace_edit_input
|
||||
{
|
||||
text-decoration: none;
|
||||
}
|
||||
|
|
@ -2245,4 +2245,18 @@ td.selectedmenu {
|
|||
background-color: #5D90CD;
|
||||
padding: 3px 20px 3px 20px;
|
||||
margin-top:20px;
|
||||
}
|
||||
}
|
||||
/*
|
||||
* Style for the Inplace Edit element
|
||||
*/
|
||||
span.inplace_edit
|
||||
{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
}
|
||||
span.inplace_edit_input
|
||||
{
|
||||
text-decoration: none;
|
||||
font-size: 110%;
|
||||
cursor: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,9 +56,9 @@ if ($action=="ok") {
|
|||
if ( trim($value ) == NULL ) $value=_("Aucune description");
|
||||
}
|
||||
$answer->set_value($value);
|
||||
echo $answer->input();
|
||||
echo $answer->value();
|
||||
}
|
||||
}
|
||||
if ($action=="cancel") {
|
||||
echo $answer->input();
|
||||
echo $answer->value();
|
||||
}
|
||||
|
|
@ -77,6 +77,7 @@ class Inplace_Edit
|
|||
echo '<a style="display:inline" class="smallbutton" id="inplace_edit_cancel'.$this->input->id.'">'._('cancel').'</a>';
|
||||
echo <<<EOF
|
||||
<script>
|
||||
$('{$this->input->id}edit').addClassName('inplace_edit_input');
|
||||
{$this->input->id}edit.onclick=null;
|
||||
inplace_edit_ok{$this->input->id}.onclick= function () {
|
||||
var json={$this->json};
|
||||
|
|
@ -98,7 +99,23 @@ EOF;
|
|||
ob_end_clean();
|
||||
return $ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief display only the value , if the action after saving or cancelling
|
||||
*
|
||||
*/
|
||||
function value()
|
||||
{
|
||||
echo $this->input->value,
|
||||
"
|
||||
<script>
|
||||
$('{$this->input->id}edit').removeClassName('inplace_edit_input');
|
||||
{$this->input->id}edit.onclick=function() {
|
||||
new Ajax.Updater('{$this->input->id}edit'
|
||||
,'{$this->callback}',
|
||||
{parameters: {$this->json} ,evalScripts:true});}
|
||||
</script>
|
||||
";
|
||||
}
|
||||
/***
|
||||
* @brief display the value with the click event
|
||||
*/
|
||||
|
|
@ -114,7 +131,8 @@ EOF;
|
|||
{$this->input->id}edit.onclick=function() {
|
||||
new Ajax.Updater('{$this->input->id}edit'
|
||||
,'{$this->callback}',
|
||||
{parameters: {$this->json} ,evalScripts:true});}
|
||||
{parameters: {$this->json} ,evalScripts:true});
|
||||
}
|
||||
</script>
|
||||
";
|
||||
$ret= ob_get_contents();
|
||||
|
|
|
|||
|
|
@ -62,13 +62,13 @@ if (!isset($_REQUEST["TestAjaxFile"])) {
|
|||
$ajax_hello->add_json_param("gDossier", Dossier::id());
|
||||
$ajax_hello->set_value($http->request("value"));
|
||||
$ajax_hello->set_callback("ajax_test.php");
|
||||
echo $ajax_hello->input();
|
||||
echo $ajax_hello->value();
|
||||
}
|
||||
if ( $action == "cancel") {
|
||||
$ajax_hello = Inplace_Edit::build($input);
|
||||
$ajax_hello->add_json_param("TestAjaxFile", __FILE__);
|
||||
$ajax_hello->add_json_param("gDossier", Dossier::id());
|
||||
$ajax_hello->set_callback("ajax_test.php");
|
||||
echo $ajax_hello->input();
|
||||
echo $ajax_hello->value();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue