From 403717ccf2e9095a44ecad059720d25d515f9bf0 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 17 Feb 2022 13:51:27 +0100 Subject: [PATCH] fix readonly and deviceslist --- ereuse_devicehub/static/js/main_inventory.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ereuse_devicehub/static/js/main_inventory.js b/ereuse_devicehub/static/js/main_inventory.js index 1c054f99..e997c917 100644 --- a/ereuse_devicehub/static/js/main_inventory.js +++ b/ereuse_devicehub/static/js/main_inventory.js @@ -15,6 +15,7 @@ $(document).ready(function() { function deviceSelect() { var devices_count = $(".deviceSelect").filter(':checked').length; + get_device_list(); if (devices_count == 0) { $("#addingLotModal .pol").show(); $("#addingLotModal .btn-primary").hide(); @@ -69,14 +70,14 @@ function newTrade(action) { var supplier = $("#supplier").data("email"); if (action == 'supplier') { title = 'Trade Incoming'; - $("#receiver").attr('disabled', 'disabled'); - $("#supplier").prop('disabled', false); + $("#receiver").attr('readonly', 'readonly'); + $("#supplier").prop('readonly', false); $("#supplier").val(''); $("#receiver").val(receiver); } else if (action == 'receiver') { title = 'Trade Outgoing'; - $("#supplier").attr('disabled', 'disabled'); - $("#receiver").prop('disabled', false); + $("#supplier").attr('readonly', 'readonly'); + $("#receiver").prop('readonly', false); $("#receiver").val(''); $("#supplier").val(supplier); } @@ -87,7 +88,6 @@ function newTrade(action) { function newAction(action) { $("#actionModal #type").val(action); $("#actionModal #title-action").html(action); - get_device_list(); deviceSelect(); $("#activeActionModal").click(); } @@ -95,7 +95,6 @@ function newAction(action) { function newAllocate(action) { $("#allocateModal #type").val(action); $("#allocateModal #title-action").html(action); - get_device_list(); deviceSelect(); $("#activeAllocateModal").click(); } @@ -103,7 +102,6 @@ function newAllocate(action) { function newDataWipe(action) { $("#datawipeModal #type").val(action); $("#datawipeModal #title-action").html(action); - get_device_list(); deviceSelect(); $("#activeDatawipeModal").click(); }