diff --git a/ddm/static/ddm/js/blueprint-edit-ui-helpers.js b/ddm/static/ddm/js/blueprint-edit-ui-helpers.js index 32cda35..0252f0d 100644 --- a/ddm/static/ddm/js/blueprint-edit-ui-helpers.js +++ b/ddm/static/ddm/js/blueprint-edit-ui-helpers.js @@ -83,7 +83,7 @@ closeModal = function(id) { * On OK-click in modal, update filter settings overview. */ $( "body" ).on("click", "button[class*='ddm-modal-ok']", function() { - const current_id = $(this).attr("id").match(/\d/)[0]; + const current_id = $(this).attr("id").match(/\d+/)[0]; hideErrorMessages(current_id); if (checkNoFieldsMissing(current_id)) { updateRuleDescription(current_id); @@ -93,7 +93,7 @@ $( "body" ).on("click", "button[class*='ddm-modal-ok']", function() { }); $( "body" ).on("click", "button[class*='ddm-modal-cancel']", function() { - const current_id = $(this).attr("id").match(/\d/)[0]; + const current_id = $(this).attr("id").match(/\d+/)[0]; let e = $("#execution_order-" + current_id); if ($.trim(e.text()) === 'None') { @@ -111,8 +111,8 @@ $( "body" ).on("click", "button[class*='ddm-modal-cancel']", function() { $(document).ready(function() { let IDs = new Set(); $("[id^=id_processingrule_set-]").each(function() { - if( /\d/.test($( this ).attr("id")) ) { - IDs.add($( this ).attr("id").match(/\d/)[0]); + if( /\d+/.test($( this ).attr("id")) ) { + IDs.add($( this ).attr("id").match(/\d+/)[0]); } }); for ( const id of IDs ) { @@ -127,8 +127,8 @@ $(document).ready(function() { $("#add-inline-form").on("click", function() { let IDs = []; $("[id^=id_processingrule_set-]").each(function() { - if( /\d/.test($(this).attr("id"))) { - IDs.push($(this).attr("id").match(/\d/)[0]); + if( /\d+/.test($(this).attr("id"))) { + IDs.push($(this).attr("id").match(/\d+/)[0]); } }); let formIdx; diff --git a/ddm/static/ddm/js/processing-rule-modal.js b/ddm/static/ddm/js/processing-rule-modal.js index b191fcb..a384956 100644 --- a/ddm/static/ddm/js/processing-rule-modal.js +++ b/ddm/static/ddm/js/processing-rule-modal.js @@ -17,16 +17,15 @@ hideOrShowReplacementAndComparisonValue = function( id ) { } $( "body" ).on("change", "select[id$='-comparison_operator']", function() { - const current_id = $(this).attr("id").match(/\d/)[0]; + const current_id = $(this).attr("id").match(/\d+/)[0]; hideOrShowReplacementAndComparisonValue(current_id); - }); $(document).ready(function() { let IDs = new Set(); $("[id$=-comparison_operator]").each(function() { - if( /\d/.test($( this ).attr("id")) ) { - IDs.add($( this ).attr("id").match(/\d/)[0]); + if( /\d+/.test($( this ).attr("id")) ) { + IDs.add($( this ).attr("id").match(/\d+/)[0]); } }); for ( const id of IDs ) {