FSN#47587 mld_note edit zorgt nu voor een editmode van de melding zodat deze niet met 1 klik weggeklikt kan worden

svn path=/Website/trunk/; revision=36213
This commit is contained in:
2017-12-05 11:19:35 +00:00
parent b0bdedafe0
commit ef5c48ffd3
2 changed files with 43 additions and 10 deletions

View File

@@ -1097,6 +1097,31 @@ var FcltMgr =
else
return false;
},
// Door een child-window aan te roepen vlak voordat hij van show naar edit mode gaat
stopEdit: function (thiswindow, params)
{
if (FcltMgr.detailManager()._editactive == thiswindow)
{
FcltMgr.detailManager()._editactive = false;
// Let op: soms wordt stopEdit aangroepen van een sub-frame (mld_show_note2.asp) maar
// soms echter ook vanuit de parent (nieuwe reservering-->res_reservering.asp)
// Die laatste zou eigen stopEdit('window van het subframe') moeten doen
// De parent.name.match(/^ID.*/) is voor de veiligheid voor als er geen frame omheen zit (touch)
if (FcltMgr._frmaccessible(parent) && thiswindow.parent && thiswindow.parent.$
&& (thiswindow != window || thiswindow.parent.name.match(/^ID.*/)))
{
thiswindow.parent.$("iframe")
.not("iframe[name="+thiswindow.name+"]").not(".frametab,.fcltmodal")
.removeClass("ui-widget-overlay ui-front");
}
FcltMgr.setTitle(null, { hot : false });
return true;
}
else
return false;
},
// Door een manager-window aan te roepen als hij wil gaan editen
mayEdit: function (thiswindow, params)

View File

@@ -67,6 +67,7 @@ var timestamp_notes = new Date();
<head>
<% FCLTHeader.Generate({outputmode: outputmode}); %>
<script>
function persoonDetails(evt, perslid_key)
{
FcltMgr.stopPropagation(evt);
@@ -74,7 +75,10 @@ var timestamp_notes = new Date();
}
function mld_notechange(mld_note_key)
{
window.location.href = "mld_show_note2.asp?urole=<%=urole%>&mld_key=<%=mld_key%>&note_key="+mld_note_key + "&tracking=<%=tracking?1:0%>";
if (FcltMgr.mayEdit(window))
{
window.location.href = "mld_show_note2.asp?urole=<%=urole%>&mld_key=<%=mld_key%>&note_key="+mld_note_key + "&tracking=<%=tracking?1:0%>";
}
}
function note_submit()
{
@@ -90,6 +94,10 @@ var timestamp_notes = new Date();
}
function note_submit_callback(json)
{
if (window.noteediting && FcltMgr.stopEdit(window))
{
window.noteediting = false;
}
if (json.canAccept && window.parent.mldFrame.mld_accept)
{
FcltMgr.confirm(L("lcl_mld_accept_3"),
@@ -135,6 +143,7 @@ var timestamp_notes = new Date();
params.appendurl = "tmp_note=" + $("#note").val() + "&parent_reload=1";
FcltMgr.reload(params);
}
function notiToggler(deze)
{
var noti = $(deze).prop('checked');
@@ -145,6 +154,7 @@ var timestamp_notes = new Date();
$('#notifyFE').prop('checked', false);
}
var note_key = <%=note_key%>;
$(function () {
$('textarea').autogrow();
// Let op: scrollen is complexer dan je denkt. Ons huidige document heeft
@@ -154,18 +164,16 @@ var timestamp_notes = new Date();
window.setTimeout('parent.scrollBy(0,$(\'#note\').height() + $(\'#note_submit\').height())', 1);
<% } %>
window.noteediting = false;
if (0) // Melding 47587, even uitgeschakeld
$("#note").keyup(function ()
{
if ($("#note").val() == "" && window.noteediting)
if (note_key == -1 && $("#note").val() == "" && window.noteediting)
{
window.noteediting = false;
// Er zou een functie FcltMgr.stopEdit moeten komen
FcltMgr.setTitle(null, {hot:false});
FcltMgr.detailManager()._editactive = false;
parent.$("iframe").not("iframe[name="+window.name+"]").not(".frametab").removeClass("ui-widget-overlay ui-front");
if (FcltMgr.stopEdit(window))
{
window.noteediting = false;
}
}
else if (!window.noteediting)
else if (!window.noteediting && (note_key > -1 || $("#note").val() != ""))
{
if (FcltMgr.startEdit(window))
{
@@ -241,7 +249,7 @@ var timestamp_notes = new Date();
}
var buttons = [];
buttons.push({ icon: "page_refresh.png", title: L("lcl_refresh"), action: "FcltMgr.reload()"});
buttons.push({ icon: "page_refresh.png", title: L("lcl_refresh"), action: "FcltMgr.stopEdit(window);FcltMgr.reload()"});
if (urole=="fo" || urole=="bo")
buttons.push({ icon: "print.png", title: L("lcl_print"), action: 'doPrint()' });