remove thumb icons for edit submit

This commit is contained in:
Oliver Gorwits
2012-11-25 17:02:06 +00:00
parent aa115a6cdf
commit 532f000c97
4 changed files with 22 additions and 45 deletions

View File

@@ -5,15 +5,15 @@
<td>[% d.name %]</td>
</tr>
<tr>
<td>Location</td>
<td>Location
[% IF vars.user.port_control %]
<i class="icon-edit nd_edit_icon nd_device_details_edit"></i>
[% END %]
</td>
[% IF vars.user.port_control %]
<td class="nd_editable_cell" contenteditable="true"
data-field="location" data-for-device="[% d.ip %]">
<i class="icon-edit nd_edit_icon nd_device_details_edit"></i>
[% d.location %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="left" data-offset="3"
data-animation="" title="Click to Apply"></i>
</td>
[% ELSE %]
<td>
@@ -23,15 +23,15 @@
[% END %]
</tr>
<tr>
<td>Contact</td>
<td>Contact
[% IF vars.user.port_control %]
<i class="icon-edit nd_edit_icon nd_device_details_edit"></i>
[% END %]
</td>
[% IF vars.user.port_control %]
<td class="nd_editable_cell" contenteditable="true"
data-field="contact" data-for-device="[% d.ip %]">
<i class="icon-edit nd_edit_icon nd_device_details_edit"></i>
[% d.contact %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="left" data-offset="3"
data-animation="" title="Click to Apply"></i>
</td>
[% ELSE %]
<td>[% d.contact %]</td>

View File

@@ -78,11 +78,6 @@
[% END %]
<div class="nd_editable_cell_content">
[% row.name | html_entity %]
[% IF vars.user.port_control AND params.c_admin %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="top" data-offset="3"
data-animation="" title="Click to Apply"></i>
[% END %]
</div>
</td>
[% END %]
@@ -105,10 +100,7 @@
data-field="c_vlan" data-for-device="[% device %]" data-for-port="[% row.port | html_entity %]">
<i class="icon-edit nd_edit_icon"></i>
<div class="nd_editable_cell_content">
[% IF row.vlan %][% row.vlan | html_entity %][% ELSE %]&nbsp;[% END %]
<i class="icon-thumbs-up nd_thumb_icon"
rel="tooltip" data-placement="top" data-offset="3"
data-animation="" title="Click to Apply"></i>
[% IF row.vlan %][% row.vlan | html_entity %][% END %]
</div>
</td>
[% ELSE %]

View File

@@ -20,16 +20,19 @@
// toggle visibility of port up/down and edit controls
$('.nd_editable_cell').hover(function() {
$(this).children('.nd_hand_icon').toggle();
$(this).children('.nd_edit_icon').toggle();
if ($(this).is(':focus')) {
$(this).children('.nd_edit_icon').toggle(false); // ports
$(this).siblings('td').find('.nd_device_details_edit').toggle(false); // details
}
else {
$(this).children('.nd_edit_icon').toggle(); // ports
$(this).siblings('td').find('.nd_device_details_edit').toggle(); // details
}
});
// toggle visibility of VLAN edit control when clicked
$('[contenteditable=true]').focus(function() {
$(this).find('.nd_thumb_icon').toggle();
});
$('[contenteditable=true]').blur(function() {
$(this).find('.nd_thumb_icon').toggle();
// can undo but CSS doesn't shift, so just do nothing for now.
$(this).children('.nd_edit_icon').toggle(false); // ports
$(this).siblings('td').find('.nd_device_details_edit').toggle(false); // details
});
// activity for port up/down control
@@ -40,12 +43,6 @@
port_control(this); // save
});
// activity for contenteditable control
$('.nd_thumb_icon').click(function() {
$(this).closest('[contenteditable=true]').blur();
port_control(this); // save
});
// activity for contenteditable control
$('[contenteditable=true]').keydown(function() {
var esc = event.which == 27,