mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-26 03:22:37 +02:00
[ticket/11556] Remove fallback JS
PHPBB3-11556
This commit is contained in:
@@ -364,8 +364,6 @@ function submit_default_button(event, selector, class_name) {
|
|||||||
* The non-jQuery code is a mimick of the jQuery code ;)
|
* The non-jQuery code is a mimick of the jQuery code ;)
|
||||||
*/
|
*/
|
||||||
function apply_onkeypress_event() {
|
function apply_onkeypress_event() {
|
||||||
// jQuery code in case jQuery is used
|
|
||||||
if (jquery_present) {
|
|
||||||
jQuery('form input[type=text], form input[type=password]').live('keypress', function (e) {
|
jQuery('form input[type=text], form input[type=password]').live('keypress', function (e) {
|
||||||
var default_button = jQuery(this).parents('form').find('input[type=submit].default-submit-action');
|
var default_button = jQuery(this).parents('form').find('input[type=submit].default-submit-action');
|
||||||
|
|
||||||
@@ -384,21 +382,4 @@ function apply_onkeypress_event() {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var input_tags = document.getElementsByTagName('input');
|
|
||||||
|
|
||||||
for (var i = 0, element = input_tags[0]; i < input_tags.length ; element = input_tags[++i]) {
|
|
||||||
if (element.type === 'text' || element.type === 'password') {
|
|
||||||
// onkeydown is possible too
|
|
||||||
element.onkeypress = function (evt) { submit_default_button((evt || window.event), this, 'default-submit-action'); };
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Detect JQuery existance. We currently do not deliver it, but some styles do, so why not benefit from it. ;)
|
|
||||||
*/
|
|
||||||
var jquery_present = typeof jQuery === 'function';
|
|
||||||
|
Reference in New Issue
Block a user