forked from ScoDoc/ScoDoc
Saisie notes : masquer DEM & ne pas copier coller
This commit is contained in:
parent
8ca59fe226
commit
e0b505ead0
@ -1049,7 +1049,19 @@ def saisie_notes(evaluation_id, group_ids=[]):
|
||||
alone=True,
|
||||
)
|
||||
)
|
||||
H.append("""</td></tr></table></div>""")
|
||||
H.append("""</td><td style="padding-left: 35px;"><button class="btn_masquer_DEM">Masquer les DEM</button></td></tr></table></div>""")
|
||||
H.append("""<style>
|
||||
.btn_masquer_DEM{
|
||||
font-size: 12px;
|
||||
}
|
||||
body.masquer_DEM .btn_masquer_DEM{
|
||||
background: #009688;
|
||||
color: #fff;
|
||||
}
|
||||
body.masquer_DEM .etud_dem{
|
||||
display: none !important;
|
||||
}
|
||||
</style>""")
|
||||
|
||||
# Le formulaire de saisie des notes:
|
||||
destination = url_for(
|
||||
|
@ -5,6 +5,7 @@ $().ready(function () {
|
||||
$("#formnotes .note").bind("blur", valid_note);
|
||||
|
||||
$("#formnotes input").bind("paste", paste_text);
|
||||
$(".btn_masquer_DEM").bind("click", masquer_DEM);
|
||||
|
||||
});
|
||||
|
||||
@ -92,6 +93,7 @@ function paste_text(e) {
|
||||
var data = clipb.getData('Text');
|
||||
var list = data.split(/\r\n|\r|\n|\t| /g);
|
||||
var currentInput = event.currentTarget;
|
||||
var masquerDEM = document.querySelector("body").classList.contains("masquer_DEM");
|
||||
|
||||
for (var i = 0; i < list.length; i++) {
|
||||
currentInput.value = list[i];
|
||||
@ -99,7 +101,15 @@ function paste_text(e) {
|
||||
evt.initEvent("blur", false, true);
|
||||
currentInput.dispatchEvent(evt);
|
||||
var sibbling = currentInput.parentElement.parentElement.nextElementSibling;
|
||||
while (sibbling && sibbling.style.display == "none") {
|
||||
while (
|
||||
sibbling &&
|
||||
(
|
||||
sibbling.style.display == "none" ||
|
||||
(
|
||||
masquerDEM && sibbling.classList.contains("etud_dem")
|
||||
)
|
||||
)
|
||||
) {
|
||||
sibbling = sibbling.nextElementSibling;
|
||||
}
|
||||
if (sibbling) {
|
||||
@ -112,3 +122,7 @@ function paste_text(e) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function masquer_DEM(){
|
||||
document.querySelector("body").classList.toggle("masquer_DEM");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user