Merge branch 'develop' of https://github.com/getgrav/grav-plugin-admin into develop

This commit is contained in:
Andy Miller
2017-09-05 16:25:23 -06:00
2 changed files with 24 additions and 20 deletions

View File

@@ -692,3 +692,5 @@ PLUGIN_ADMIN:
2FA_SECRET: "2FA Secret"
2FA_SECRET_HELP: "Scan this QR code into your [Authenticator App](https://learn.getgrav.org/admin-panel/2fa#apps). Also it's a good idea to backup the secret in a safe location, in case you need to reinstall your app. Check the [Grav docs](https://learn.getgrav.org/admin-panel/2fa) for more information "
2FA_REGENERATE: "Regenerate"
CASE_INSENSITIVE_URLS: "Case Insensitive URLs"
CASE_INSENSITIVE_URLS_HELP: "Enables Grav routing to locate resources regardless of text case."

View File

@@ -51,27 +51,29 @@
var form = this,
$fields = $('[form=' + this.id + ']');
$fields.filter('button, input').filter('[type=reset],[type=submit]').click(function() {
var type = this.type.toLowerCase();
if (type === 'reset') {
// reset form
form.reset();
// for elements outside form
$fields.each(function() {
this.value = this.defaultValue;
this.checked = this.defaultChecked;
}).filter('select').each(function() {
$(this).find('option').each(function() {
this.selected = this.defaultSelected;
$fields.filter('button, input')
.filter('[type=reset],[type=submit],[type=image],button')
.click(function() {
var type = this.type.toLowerCase();
if (type === 'reset') {
// reset form
form.reset();
// for elements outside form
$fields.each(function() {
this.value = this.defaultValue;
this.checked = this.defaultChecked;
}).filter('select').each(function() {
$(this).find('option').each(function() {
this.selected = this.defaultSelected;
});
});
});
} else if (type.match(/^submit|image$/i)) {
$(form).appendField({
name: this.name,
value: this.value
}).submit();
}
});
} else {
$(form).appendField({
name: this.name,
value: this.value
}).submit();
}
});
});
});