From 26386c9e7d7516a60c4ab1c8fae4bdcce82c7a04 Mon Sep 17 00:00:00 2001 From: Garrett K Date: Sat, 6 Mar 2021 05:56:15 +0000 Subject: [PATCH] 0.3.14 --- assets/pages/jquery.templates.js | 26 +++++++++++++++++++++++++- includes/modals.php | 23 ----------------------- templates.php | 2 +- 3 files changed, 26 insertions(+), 25 deletions(-) diff --git a/assets/pages/jquery.templates.js b/assets/pages/jquery.templates.js index 55f3a88..c43f61d 100755 --- a/assets/pages/jquery.templates.js +++ b/assets/pages/jquery.templates.js @@ -807,6 +807,10 @@ function makeRackObjectsClickable(){ }); }); } + + // Public data + $(document).data('selectedObjectName', response.templateName); + $(document).data('selectedObjectCategoryName', response.categoryName); } }); }); @@ -1882,8 +1886,28 @@ $( document ).ready(function() { $(variables['selectedObj']).click(); }); + $('#objDelete').click(function(e){ + + // Prevent browser following # link + e.preventDefault(); + + if($(this).hasClass('disabled')) { + + // Prevent modal from showing + e.stopPropagation(); + + } else { + + var objectName = $(document).data('selectedObjectName'); + var objectCategoryName = $(document).data('selectedObjectCategoryName'); + + $('#modalConfirmTitle').html('Delete Template'); + $('#modalConfirmBody').html('Delete '+objectName+' ('+objectCategoryName+')?'); + } + }); + // Delete a temlate - $('#confirmObjDelete').click(function(){ + $('#modalConfirmBtn').click(function(){ var templateCombined = $(document).data('selectedTemplateCombined'); if (templateCombined == 'yes') { var templateID = $(document).data('selectedTemplateCombinedID'); diff --git a/includes/modals.php b/includes/modals.php index 619cc64..52ebb9c 100755 --- a/includes/modals.php +++ b/includes/modals.php @@ -710,29 +710,6 @@ - - -