Skip to content
Snippets Groups Projects
Commit 6a726e24 authored by Kamil Domanski's avatar Kamil Domanski
Browse files

changed app enable status to buttons

parent e047feb2
No related branches found
No related tags found
No related merge requests found
......@@ -13,16 +13,14 @@ table td.version, table td.enabled, table td.disabled
text-align: center;
}
table td.enabled
input[type="button"].enabled
{
color: #006600;
font-weight: bold;
}
table td.disabled
input[type="button"].disabled
{
color: #660000;
font-weight: bold;
}
.preview
......@@ -65,3 +63,6 @@ table td.name a
}
input[type="button"].appbutton { padding:0.1em 1em; border:1px solid #999; font-weight:bold; font-size:0.9em; cursor:pointer; }
input[type="button"]:hover.appbutton, form input[type="submit"]:focus { border:1px solid #999; background-color:#999; outline:0; }
input[type="button"]:active.appbutton { outline:0; }
\ No newline at end of file
$("div[x-use='appenableddiv']").live( "click", function(){
$("input[x-use='appenablebutton']").live( "click", function(){
appid = $(this).parent().parent().attr("x-uid");
if($(this).text() == "enabled"){
$(this).html( "disabled" );
$(this).parent().removeClass( "enabled" );
$(this).parent().addClass( "disabled" );
//alert("dsfsdfsdf");
if($(this).val() == "enabled"){
$(this).attr("value","disabled");
$(this).removeClass( "enabled" );
$(this).addClass( "disabled" );
//$.post( "ajax/disableapp.php", $(appid).serialize(), function(data){} );
$.post( "ajax/disableapp.php", { appid: appid }, function(data){ alert(data.status);});
}
else if($(this).text() == "disabled"){
$(this).html( "enabled" );
$(this).parent().removeClass( "disabled" );
$(this).parent().addClass( "enabled" );
else if($(this).val() == "disabled"){
$(this).attr("value","enabled");
$(this).removeClass( "disabled" );
$(this).addClass( "enabled" );
$.post( "ajax/enableapp.php", { appid: appid }, function(data){ alert(data.status);} );
}
});
\ No newline at end of file
......@@ -20,7 +20,7 @@
<td class="name" width="200"><?php echo($app['name']); ?></td>
<td class="version"><?php echo($app['version']); ?></td>
<td><?php echo($app['author']); ?></td>
<td class="<?php echo $app['enabled'] ? 'enabled' : 'disabled' ?>"><div x-use="appenableddiv"><?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?></div></td>
<td><input x-use="appenablebutton" type='button' value='<?php echo $l->t( $app['enabled'] ? 'enabled' : 'disabled' ); ?>' class='appbutton prettybutton <?php echo( $app['enabled'] ? 'enabled' : 'disabled' ); ?>'/></td>
</tr>
<?php endforeach; ?>
</tbody>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment