liquid_feedback_frontend

changeset 1762:048d6bae2855

Fixed dialog cross-browser functionality
author bsw
date Mon Oct 18 11:10:31 2021 +0200 (2021-10-18)
parents 7df91db759ce
children 0f04f8c2a469
files app/main/initiative/_suggestions.lua static/js/xhr.js static/lf4.css
line diff
     1.1 --- a/app/main/initiative/_suggestions.lua	Fri Oct 15 09:57:42 2021 +0200
     1.2 +++ b/app/main/initiative/_suggestions.lua	Mon Oct 18 11:10:31 2021 +0200
     1.3 @@ -6,7 +6,7 @@
     1.4  
     1.5  
     1.6  if direct_supporter then
     1.7 -  ui.tag{ tag = "dialog", attr = { id = "rating_dialog" }, content = function ()
     1.8 +  ui.tag{ tag = "div", attr = { id = "rating_dialog", class = "hidden" }, content = function ()
     1.9  
    1.10      local opinion = {}
    1.11      ui.form { 
    1.12 @@ -112,7 +112,7 @@
    1.13          ui.tag{
    1.14            tag = "input",
    1.15            attr = {
    1.16 -            onclick = "document.getElementById('rating_dialog').close(); return false;",
    1.17 +            onclick = "document.getElementById('rating_dialog').classList.add('hidden'); return false;",
    1.18              type = "submit",
    1.19              class = "mdl-button mdl-js-button",
    1.20              value = _"cancel"
     2.1 --- a/static/js/xhr.js	Fri Oct 15 09:57:42 2021 +0200
     2.2 +++ b/static/js/xhr.js	Mon Oct 18 11:10:31 2021 +0200
     2.3 @@ -41,7 +41,9 @@
     2.4      document.getElementById('rating_fulfilled').MaterialRadio.uncheck();    
     2.5      document.getElementById('rating_notfulfilled').MaterialRadio.uncheck();    
     2.6    }
     2.7 -  document.getElementById('rating_dialog').showModal();
     2.8 +//  document.getElementById('rating_dialog').showModal();
     2.9 +  document.getElementById('rating_dialog').classList.remove("hidden");
    2.10 +
    2.11  }
    2.12  
    2.13  function updateOpinion() {
    2.14 @@ -102,7 +104,8 @@
    2.15      document.getElementById("s" + suggestionId + "_rate_button").innerHTML = rateSuggestionUpdateRatingText;
    2.16    }
    2.17    document.getElementById("s" + suggestionId + "_rate_button").setAttribute("onclick", "rateSuggestion(" + suggestionId + ", " + degree + ", " + fulfilled + ");return false;")
    2.18 -  document.getElementById('rating_dialog').close();
    2.19 +//  document.getElementById('rating_dialog').close();
    2.20 +  document.getElementById('rating_dialog').classList.add("hidden");
    2.21  
    2.22    fetch(baseURL + "opinion/xhr_update", {
    2.23      method: "POST",
     3.1 --- a/static/lf4.css	Fri Oct 15 09:57:42 2021 +0200
     3.2 +++ b/static/lf4.css	Mon Oct 18 11:10:31 2021 +0200
     3.3 @@ -741,6 +741,31 @@
     3.4    margin-top: 0;
     3.5  }
     3.6  
     3.7 +#rating_dialog {
     3.8 +  position: fixed;
     3.9 +  top: 0px;
    3.10 +  bottom: 0px;
    3.11 +  max-width: calc((100% - 6px) - 2em);
    3.12 +  max-height: calc((100% - 6px) - 2em);
    3.13 +  overflow: auto;  
    3.14 +  display: block;
    3.15 +  left: 0px;
    3.16 +  right: 0px;
    3.17 +  width: fit-content;
    3.18 +  width: -moz-fit-content;
    3.19 +  height: fit-content;
    3.20 +  height: -moz-fit-content;
    3.21 +  color: #000;
    3.22 +  margin: auto;
    3.23 +  border-width: initial;
    3.24 +  border-style: solid;
    3.25 +  border-color: initial;
    3.26 +  border-image: initial;
    3.27 +  padding: 1em;
    3.28 +  background: #fff;
    3.29 +  z-index: 1;
    3.30 +}
    3.31 +
    3.32  .survey_counter {
    3.33    position: absolute;;
    3.34    right: 20px;

Impressum / About Us