|
@@ -266,15 +266,21 @@ function fastLoad(_href, _history = true, _useCache = true, _replaceState = fals
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-function initPrimaryForm() {
|
|
|
- var primaryForm = $('.primary-form:visible');
|
|
|
+function initPrimaryForm(_form = false) {
|
|
|
+ var primaryForm = _form ? _form : $('.primary-form:visible');
|
|
|
if (primaryForm.length) {
|
|
|
- var rte = primaryForm.first().find('[contenteditable="true"]').first();
|
|
|
+ primaryForm = primaryForm.first();
|
|
|
+ var rte = primaryForm.find('[contenteditable="true"]').first();
|
|
|
if(rte.length) {
|
|
|
rte.focus().select();
|
|
|
}
|
|
|
else {
|
|
|
- primaryForm.first().find('input, textarea, select').first().focus().select();
|
|
|
+ if(primaryForm.find('[autofocus]:visible').length) {
|
|
|
+ primaryForm.find('[autofocus]:visible').first().focus().select();
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ primaryForm.find('input:not([type="hidden"]):visible, textarea:visible, select:visible').first().focus().select();
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|