Parcourir la source

disable button when send video

deployer il y a 3 ans
Parent
commit
5bedb98c89
2 fichiers modifiés avec 9 ajouts et 8 suppressions
  1. 3 4
      api/static/reset_pwd.js
  2. 6 4
      api/static/script_util.js

+ 3 - 4
api/static/reset_pwd.js

@@ -15,8 +15,8 @@ function renderXHR_data(jsonObj) {
 
 $(".sender").click(function () {
 
-  var pwd = $("#in_pwd").val;
-  var code = $("#code").val;
+  var pwd = $("#in_pwd").val();
+  var code = $("#code").val();
   
   var url = "/reset_pwd";
 
@@ -32,8 +32,7 @@ xhr.onreadystatechange = function () {
    }};
 
 
-var  dataOBJ = { "coed": code, "password": pwd}
-data = renderXHR_data(dataOBJ)
+var data = `{"code":"`+ code+`","password":"`+pwd+`"}`
 
 xhr.send(data);
 });

+ 6 - 4
api/static/script_util.js

@@ -113,10 +113,11 @@ function prepareUpload(event) {
 const button = document.querySelector('.next');
 
 $(".next").click(function () {
-  button.setAttribute('disabled', '');
-  setTimeout(function () {
-    button.removeAttribute('disabled')
-  }, 4000);
+  $(".next").prop("disabled",true);
+  //button.setAttribute('disabled', '');
+  //setTimeout(function () {
+  //  button.removeAttribute('disabled')
+  //}, 4000);
   avatar = $('.avatar').val();
   name_title = $('.title_new').val();
   txtARR = [];
@@ -146,6 +147,7 @@ $(".next").click(function () {
   xhr.setRequestHeader("Authorization","Bearer "+jwt_token)
   xhr.setRequestHeader("Content-Type", "application/json");
   xhr.onreadystatechange = function () {
+    $(".next").prop("disabled",false)
     if (xhr.readyState === 4) {
       responseOBJ = JSON.parse(xhr.responseText)
       if (responseOBJ.msg=='ok')