Bug mit Popups behoben
Speichern-Button bei der Unterschriftenfunktion ist jetzt über dem Canvas Canvas-Inhalt wird beim drehen beibehalten.
This commit is contained in:
@@ -13,6 +13,9 @@ function hideSpinner() {
|
||||
|
||||
function showMessagePopup(title, message) {
|
||||
$("#popupTitle").text(title);
|
||||
if(message !== null) {
|
||||
$("#modal-body").html("<p id=\"popupMessage\"></p>");
|
||||
}
|
||||
$("#popupMessage").text(message);
|
||||
|
||||
$("#messagePopup").modal(
|
||||
@@ -25,6 +28,11 @@ function showMessagePopup(title, message) {
|
||||
|
||||
function showMessagePopupWithCallback(title, message, callback, executeCallbackByBothButtons) {
|
||||
$("#popupTitle").text(title);
|
||||
|
||||
if (message !== null) {
|
||||
$("#modal-body").html("<p id=\"popupMessage\"></p>");
|
||||
}
|
||||
|
||||
$("#popupMessage").text(message);
|
||||
|
||||
$("#message-popup-ok-btn").on("click", function() {
|
||||
@@ -32,8 +40,7 @@ function showMessagePopupWithCallback(title, message, callback, executeCallbackB
|
||||
});
|
||||
|
||||
if (executeCallbackByBothButtons === true) {
|
||||
$("#message-popup-close-btn").on("click",
|
||||
function() {
|
||||
$("#message-popup-close-btn").on("click", function() {
|
||||
callback();
|
||||
});
|
||||
}
|
||||
@@ -85,6 +92,9 @@ function isInArray(value, array) {
|
||||
|
||||
function showMessagePopupWithHtml(title, html) {
|
||||
$("#popupTitle").text(title);
|
||||
if(message !== null) {
|
||||
$("#modal-body").html("<p id=\"popupMessage\"></p>");
|
||||
}
|
||||
$("#popupMessage").html(html);
|
||||
|
||||
$("#messagePopup").modal(
|
||||
@@ -112,10 +122,17 @@ function hasEmptyRequiredFields(form) {
|
||||
}
|
||||
|
||||
function showAboutPopup() {
|
||||
// Auf deutsch?
|
||||
var text = "SignaturePad:<br/>Copyright (c) 2018 Szymon Nowak<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:<br/>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.<br/>THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.";
|
||||
|
||||
$("#message-popup-ok-btn").unbind();
|
||||
$("#message-popup-close-btn").unbind();
|
||||
|
||||
$("#popupTitle").text("Copyrights");
|
||||
$("#popupMessage").html(text);
|
||||
|
||||
$("#modal-body").html("<p id=\"popupMessage\"></p>");
|
||||
|
||||
$("#modal-body").html(text);
|
||||
|
||||
$("#messagePopup").modal(
|
||||
{
|
||||
|
||||
@@ -31,7 +31,20 @@ function resizeCanvas(sketchPadId, canvasRoId) {
|
||||
}
|
||||
|
||||
if(isMinDifferenceMet) {
|
||||
console.log("changing canvas size");
|
||||
var sourceCanvas = document.getElementById(sketchPadId.split("#")[1]);
|
||||
var canvasContext = sourceCanvas.getContext("2d");
|
||||
var imageData = sourceCanvas.toDataURL("image/png");
|
||||
|
||||
$(sketchPadId).prop("width", newWidth);
|
||||
|
||||
var img = new Image;
|
||||
|
||||
img.onload = function() {
|
||||
canvasContext.drawImage(img, 0, 0);
|
||||
};
|
||||
|
||||
img.src = imageData;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -363,7 +363,7 @@ function validateForm(form) {
|
||||
if(isValid === false) {
|
||||
hideSpinner();
|
||||
$("#messagePopup .modal-body").html('<div class="alert alert-danger" role="alert">' + errorMessage + "</div>");
|
||||
|
||||
|
||||
showMessagePopupWithCallback("Fehler", null, function() {
|
||||
$("#messagePopup .modal-body").html();
|
||||
}, true);
|
||||
@@ -385,7 +385,7 @@ function validateForm(form) {
|
||||
var kannTrotzdemGespeichertWerden = message.KannTrotzdemGespeichertWerden;
|
||||
|
||||
var background = kannTrotzdemGespeichertWerden ? "alert-warning" : "alert-danger";
|
||||
|
||||
|
||||
$("#messagePopup .modal-body").html('<div class="alert ' + background + '" role="alert">' + message.Message + "</div>");
|
||||
|
||||
showMessagePopupWithCallback("Fehler", null, function() {
|
||||
|
||||
@@ -1512,18 +1512,18 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mt-3" id="canvas-row">
|
||||
<div class="canvas-container" id="canvas-container">
|
||||
<canvas id="sketch-pad" width="500" height="200" class="bg-white" style="border: 1px solid #343A40;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<button type="button" class="btn btn-primary float-right" id="save-signature-btn">Speichern</button>
|
||||
<button type="button" class="btn btn-secondary float-right mr-3" id="clear-canvas-btn">Neu</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mt-3" id="canvas-row">
|
||||
<div class="canvas-container" id="canvas-container">
|
||||
<canvas id="sketch-pad" width="500" height="200" class="bg-white" style="border: 1px solid #343A40;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="service-record-oid-holder" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="modal-body" id="modal-body">
|
||||
<p id="popupMessage"></p>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
Reference in New Issue
Block a user