From 7eae64a26bef923319101fb5f5ffa10f9c4f11f8 Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Thu, 9 Oct 2014 15:24:12 -0700 Subject: [PATCH] constantize the delete row button classes --- domain-server/resources/web/js/settings.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/domain-server/resources/web/js/settings.js b/domain-server/resources/web/js/settings.js index 69c52ceb6c..923a01a8a9 100644 --- a/domain-server/resources/web/js/settings.js +++ b/domain-server/resources/web/js/settings.js @@ -6,6 +6,8 @@ var Settings = { DATA_COL_CLASS: 'value-col', ADD_ROW_BUTTON_CLASS: 'add-row', ADD_ROW_SPAN_CLASSES: 'glyphicon glyphicon-plus add-row', + DEL_ROW_BUTTON_CLASS: 'del-row', + DEL_ROW_SPAN_CLASSES: 'glyphicon glyphicon-remove del-row', TABLE_BUTTONS_CLASS: 'buttons', NEW_ROW_CLASS: 'new-row' }; @@ -101,7 +103,7 @@ $(document).ready(function(){ addTableRow(this); }) - $('#settings-form').on('click', '.del-row', function(){ + $('#settings-form').on('click', '.' + Settings.DEL_ROW_BUTTON_CLASS, function(){ deleteTableRow(this); }) @@ -288,7 +290,7 @@ function makeTable(setting, setting_name, setting_value) { html += "" }) - html += "" + html += "" html += "" row_num++ @@ -417,7 +419,7 @@ function addTableRow(add_glyphicon) { // Change buttons var span = $(element).children("span") span.removeClass(Settings.ADD_ROW_SPAN_CLASSES) - span.addClass("glyphicon glyphicon-remove del-row") + span.addClass(Settings.DEL_ROW_SPAN_CLASSES) } else if ($(element).hasClass("key")) { var input = $(element).children("input") $(element).html(input.val())