Jshint unused and undef cleanup for forms, heattop JS

Removing unused and undefined variables in forms, formset_table,
heattop javascript. This ensures that once we enable it globally,
the gate will not barf.

Change-Id: I3d0b21dd1813fe83f28c2488cd308eee680ed690
Partial-Bug: #1438620
This commit is contained in:
Cindy Lu 2015-04-22 20:35:12 -07:00
parent bafcfb02de
commit 7ed405fe14
3 changed files with 11 additions and 12 deletions

View File

@ -1,7 +1,7 @@
/* Namespace for core functionality related to Forms. */
horizon.forms = {
handle_snapshot_source: function() {
$("div.table_wrapper, #modal_wrapper").on("change", "select#id_snapshot_source", function(evt) {
$("div.table_wrapper, #modal_wrapper").on("change", "select#id_snapshot_source", function() {
var $option = $(this).find("option:selected");
var $form = $(this).closest('form');
var $volName = $form.find('input#id_name');
@ -18,7 +18,7 @@ horizon.forms = {
},
handle_volume_source: function() {
$("div.table_wrapper, #modal_wrapper").on("change", "select#id_volume_source", function(evt) {
$("div.table_wrapper, #modal_wrapper").on("change", "select#id_volume_source", function() {
var $option = $(this).find("option:selected");
var $form = $(this).closest('form');
var $volName = $form.find('input#id_name');
@ -35,7 +35,7 @@ horizon.forms = {
},
handle_image_source: function() {
$("div.table_wrapper, #modal_wrapper").on("change", "select#id_image_source", function(evt) {
$("div.table_wrapper, #modal_wrapper").on("change", "select#id_image_source", function() {
var $option = $(this).find("option:selected");
var $form = $(this).closest('form');
var $volName = $form.find('input#id_name');
@ -63,7 +63,7 @@ horizon.forms = {
* compare with the value of the new filename string.
*/
handle_object_upload_source: function() {
$("div.table_wrapper, #modal_wrapper").on("change", "input#id_object_file", function(evt) {
$("div.table_wrapper, #modal_wrapper").on("change", "input#id_object_file", function() {
if (typeof($(this).attr("filename")) === 'undefined') {
$(this).attr("filename", "");
}
@ -102,7 +102,7 @@ horizon.forms = {
var endDate = $('input#id_end').datepicker({
language: horizon.datepickerLocale,
startDate: startDate ? startDate.dates[0] : null
}).on('changeDate', function(ev) {
}).on('changeDate', function() {
endDate.hide();
}).data('datepicker');
@ -313,7 +313,7 @@ horizon.addInitFunction(horizon.forms.init = function () {
$(modal).find('input.switchable').trigger('change');
});
$document.on('shown.bs.tab', function(evt) {
$document.on('shown.bs.tab', function() {
var $fieldset = $('fieldset.active');
var $btnfinal = $('.button-final');
if ($btnfinal.data('show-on-tab')) {
@ -341,7 +341,7 @@ horizon.addInitFunction(horizon.forms.init = function () {
});
}
$document.on('change', '#id_volume_source_type', function (evt) {
$document.on('change', '#id_volume_source_type', function () {
update_volume_source_displayed_fields(this);
});
@ -366,7 +366,7 @@ horizon.addInitFunction(horizon.forms.init = function () {
});
// Hide the tooltip upon interaction with the field for select boxes.
// We use mousedown and keydown since those "open" the select dropdown.
$document.on('mousedown keydown', '.form-group select', function (evt) {
$document.on('mousedown keydown', '.form-group select', function () {
$(this).tooltip('hide');
});
// Hide the tooltip after escape button pressed

View File

@ -24,7 +24,7 @@ horizon.formset_table = (function () {
};
// mark a row as deleted and hide it
module.delete_row = function (e) {
module.delete_row = function () {
$(this).closest('tr').hide();
$(this).prev('input[name$="-DELETE"]').attr('checked', true);
};

View File

@ -48,9 +48,8 @@ function update(){
//Setup click action for all nodes
node.on("mouseover", function(d) {
$("#info_box").html(d.info_box);
current_info = d.name;
});
node.on("mouseout", function(d) {
node.on("mouseout", function() {
$("#info_box").html('');
});
@ -191,7 +190,7 @@ function ajax_poll(poll_time){
//Check for updates and new nodes
json.nodes.forEach(function(d){
current_node = findNode(d.name);
var current_node = findNode(d.name);
//Check if node already exists
if (current_node) {
//Node already exists, just update it