Core: Unhighlighting field if already highlighted when using remote rule.

Closes #1712. Refs #1669, #1375, #12.
This commit is contained in:
Lars Skjelbek
2016-02-15 00:24:43 +01:00
committed by Markus Staab
parent 5fc3585c2a
commit e9fd71d89b
4 changed files with 71 additions and 3 deletions

View File

@@ -42,7 +42,16 @@ $.mockjax( {
$.mockjax( {
url: "response.php",
response: function( settings ) {
this.responseText = settings.data.responseText || "";
var responseText = settings.data.responseText;
if ( responseText ) {
if ( typeof responseText === "function" ) {
this.responseText = responseText();
} else {
this.responseText = responseText;
}
} else {
this.responseText = "";
}
this.responseStatus = settings.data.responseStatus || 200;
this.responseTime = settings.data.responseTime || 100;
}