Commit d7961f26 authored by Dimitris Moraitis's avatar Dimitris Moraitis
Browse files

rename fixes - Refs #307

parent c8f3764b
......@@ -754,6 +754,7 @@ a.name:hover span.rename {
color: #3D3D3D;
margin-top: 0.4em;
background-image: url(/static/pencil.png);
background-position: 0 3px;
}
......@@ -1431,6 +1432,14 @@ div#user a.current_lang {
}
.editbuttons {
display: block;
clear: none;
width: 40px;
margin-right:34%;
margin-top:3px;
float:right;
}
.editbuttons img {
float:none !important;
margin: 0px !important;
}
......
......@@ -23,8 +23,10 @@
<a href="#" class="name">
<h5 class="namecontainer">
{% trans "Name: " %}<span class="name">node.name</span><span class="rename"></span>
<img class="editbuttons save" style="display:none" src="/static/save.png" />
<img class="editbuttons cancel" style="display:none" src="/static/cancel.png" />
<div class="editbuttons" style="display:none">
<img class="save" src="/static/save.png" />
<img class="cancel" src="/static/cancel.png" />
</div>
</h5>
</a>
<a href="#" class="ip">
......@@ -72,18 +74,18 @@ $("a.show-metadata").live('click', function() {
});
//rename machine
$(".rename").live('click', function() {
$(".rename, h5.namecontainer span.name").live('click', function() {
$(this).parent().find('.name').html("<input id=\"txtEdit\" type=\"text\" class=\"nametextbox\" value=\"" + $(this).parent().find('.name').text() + "\" / ><span class=\"oldValue\" style=\"display:none;\" >" + $(this).parent().find('.name').text() + "</span>");
$(this).fadeOut("fast");
$(this).parent().find(".editbuttons").fadeIn("slow");
$(this).parent().find('.rename').hide();
$(this).parent().find(".editbuttons").fadeIn();
});
//cancel renaming
$(".editbuttons.cancel").live('click', function() {
$(".editbuttons .cancel").live('click', function() {
console.info($(this).parent().parent().find('.name').find('.oldValue').text());
$(this).parent().parent().find('.name').html($(this).parent().parent().find('.name').find('.oldValue').text());
$(this).parent().parent().find(".editbuttons").fadeOut("fast");
$(this).parent().parent().find(".rename").fadeIn("slow");
$(this).parent().parent().find(".editbuttons").hide();
$(this).parent().parent().find(".rename").fadeIn();
});
// intercept reboot click
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment