Commit d8442c8e authored by alexpott's avatar alexpott

Issue #2473953 by mortendk, rteijeiro, rachel_norfolk, Cottser, aburrows,...

Issue #2473953 by mortendk, rteijeiro, rachel_norfolk, Cottser, aburrows, LewisNyman: Prefix form-submit classes with js-
parent 241def35
......@@ -76,7 +76,7 @@ public static function preRenderButton($element) {
if (!empty($element['#button_type'])) {
$element['#attributes']['class'][] = 'button--' . $element['#button_type'];
}
// @todo Various JavaScript depends on this button class.
$element['#attributes']['class'][] = 'js-form-submit';
$element['#attributes']['class'][] = 'form-submit';
if (!empty($element['#attributes']['disabled'])) {
......
......@@ -85,7 +85,7 @@ public static function preRenderButton($element) {
if (!empty($element['#button_type'])) {
$element['#attributes']['class'][] = 'image-button--' . $element['#button_type'];
}
// @todo Various JavaScript depends on this button class.
$element['#attributes']['class'][] = 'js-form-submit';
$element['#attributes']['class'][] = 'form-submit';
if (!empty($element['#attributes']['disabled'])) {
......
......@@ -513,7 +513,7 @@
if (e.trigger) {
$(e.target)
.prop('disabled', e.value)
.closest('.form-item, .form-submit, .form-wrapper').toggleClass('form-disabled', e.value)
.closest('.form-item, .js-form-submit, .form-wrapper').toggleClass('form-disabled', e.value)
.find('select, input, textarea').prop('disabled', e.value);
// Note: WebKit nightlies don't reflect that change correctly.
......@@ -538,7 +538,7 @@
$(document).on('state:visible', function (e) {
if (e.trigger) {
$(e.target).closest('.form-item, .form-submit, .form-wrapper').toggle(e.value);
$(e.target).closest('.form-item, .js-form-submit, .form-wrapper').toggle(e.value);
}
});
......
......@@ -67,13 +67,13 @@
Drupal.behaviors.fileButtons = {
attach: function (context) {
var $context = $(context);
$context.find('.form-submit').on('mousedown', Drupal.file.disableFields);
$context.find('.form-managed-file .form-submit').on('mousedown', Drupal.file.progressBar);
$context.find('.js-form-submit').on('mousedown', Drupal.file.disableFields);
$context.find('.form-managed-file .js-form-submit').on('mousedown', Drupal.file.progressBar);
},
detach: function (context) {
var $context = $(context);
$context.find('.form-submit').off('mousedown', Drupal.file.disableFields);
$context.find('.form-managed-file .form-submit').off('mousedown', Drupal.file.progressBar);
$context.find('.js-form-submit').off('mousedown', Drupal.file.disableFields);
$context.find('.form-managed-file .js-form-submit').off('mousedown', Drupal.file.progressBar);
}
};
......@@ -128,7 +128,7 @@
* Trigger the upload_button mouse event to auto-upload as a managed file.
*/
triggerUploadButton: function (event) {
$(event.target).closest('.form-managed-file').find('.form-submit').trigger('mousedown');
$(event.target).closest('.form-managed-file').find('.js-form-submit').trigger('mousedown');
},
/**
* Prevent file uploads when using buttons not intended to upload.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment