summaryrefslogtreecommitdiffstats
path: root/core/modules/views_ui
diff options
context:
space:
mode:
authorwebchick2017-12-03 16:16:29 (GMT)
committerwebchick2017-12-03 16:16:29 (GMT)
commit8d06691e00903a0e899ceffab84cf8263eea5c7d (patch)
treedef90b279537149d5a391fff05f4d5db671f8285 /core/modules/views_ui
parent01576f24da90a85484aff75df38dc584ac24aa7f (diff)
Issue #2927230 by drpal, dawehner: 3/3 JS codestyle: camelcase
Diffstat (limited to 'core/modules/views_ui')
-rw-r--r--core/modules/views_ui/js/ajax.es6.js58
-rw-r--r--core/modules/views_ui/js/ajax.js58
-rw-r--r--core/modules/views_ui/js/views-admin.es6.js4
-rw-r--r--core/modules/views_ui/js/views-admin.js4
4 files changed, 62 insertions, 62 deletions
diff --git a/core/modules/views_ui/js/ajax.es6.js b/core/modules/views_ui/js/ajax.es6.js
index 73f2b96..ab2ed06 100644
--- a/core/modules/views_ui/js/ajax.es6.js
+++ b/core/modules/views_ui/js/ajax.es6.js
@@ -36,19 +36,19 @@
// Identify the button that was clicked so that .ajaxSubmit() can use it.
// We need to do this for both .click() and .mousedown() since JavaScript
// code might trigger either behavior.
- const $submit_buttons = $form.find('input[type=submit].js-form-submit, button.js-form-submit').once('views-ajax-submit');
- $submit_buttons.on('click mousedown', function () {
+ const $submitButtons = $form.find('input[type=submit].js-form-submit, button.js-form-submit').once('views-ajax-submit');
+ $submitButtons.on('click mousedown', function () {
this.form.clk = this;
});
$form.once('views-ajax-submit').each(function () {
const $form = $(this);
- const element_settings = {
+ const elementSettings = {
url: response.url,
event: 'submit',
base: $form.attr('id'),
element: this,
};
- const ajaxForm = Drupal.ajax(element_settings);
+ const ajaxForm = Drupal.ajax(elementSettings);
ajaxForm.$form = $form;
});
};
@@ -159,9 +159,9 @@
$('#views-tabset a').once('views-ajax').on('click', function () {
const href = $(this).attr('href');
// Cut of #views-tabset.
- const display_id = href.substr(11);
+ const displayId = href.substr(11);
// Set the form element.
- $('#views-live-preview #preview-display-id').val(display_id);
+ $('#views-live-preview #preview-display-id').val(displayId);
});
},
};
@@ -177,20 +177,20 @@
Drupal.behaviors.viewsAjax = {
collapseReplaced: false,
attach(context, settings) {
- const base_element_settings = {
+ const baseElementSettings = {
event: 'click',
progress: { type: 'fullscreen' },
};
// Bind AJAX behaviors to all items showing the class.
$('a.views-ajax-link', context).once('views-ajax').each(function () {
- const element_settings = base_element_settings;
- element_settings.base = $(this).attr('id');
- element_settings.element = this;
+ const elementSettings = baseElementSettings;
+ elementSettings.base = $(this).attr('id');
+ elementSettings.element = this;
// Set the URL to go to the anchor.
if ($(this).attr('href')) {
- element_settings.url = $(this).attr('href');
+ elementSettings.url = $(this).attr('href');
}
- Drupal.ajax(element_settings);
+ Drupal.ajax(elementSettings);
});
$('div#views-live-preview a')
@@ -200,18 +200,18 @@
return true;
}
- const element_settings = base_element_settings;
+ const elementSettings = baseElementSettings;
// Set the URL to go to the anchor.
- element_settings.url = $(this).attr('href');
- if (Drupal.Views.getPath(element_settings.url).substring(0, 21) !== 'admin/structure/views') {
+ elementSettings.url = $(this).attr('href');
+ if (Drupal.Views.getPath(elementSettings.url).substring(0, 21) !== 'admin/structure/views') {
return true;
}
- element_settings.wrapper = 'views-preview-wrapper';
- element_settings.method = 'replaceWith';
- element_settings.base = $(this).attr('id');
- element_settings.element = this;
- Drupal.ajax(element_settings);
+ elementSettings.wrapper = 'views-preview-wrapper';
+ elementSettings.method = 'replaceWith';
+ elementSettings.base = $(this).attr('id');
+ elementSettings.element = this;
+ Drupal.ajax(elementSettings);
});
// Within a live preview, make exposed widget form buttons re-trigger the
@@ -224,20 +224,20 @@
this.form.clk = this;
return true;
});
- const element_settings = base_element_settings;
+ const elementSettings = baseElementSettings;
// Set the URL to go to the anchor.
- element_settings.url = $(this.form).attr('action');
- if (Drupal.Views.getPath(element_settings.url).substring(0, 21) !== 'admin/structure/views') {
+ elementSettings.url = $(this.form).attr('action');
+ if (Drupal.Views.getPath(elementSettings.url).substring(0, 21) !== 'admin/structure/views') {
return true;
}
- element_settings.wrapper = 'views-preview-wrapper';
- element_settings.method = 'replaceWith';
- element_settings.event = 'click';
- element_settings.base = $(this).attr('id');
- element_settings.element = this;
+ elementSettings.wrapper = 'views-preview-wrapper';
+ elementSettings.method = 'replaceWith';
+ elementSettings.event = 'click';
+ elementSettings.base = $(this).attr('id');
+ elementSettings.element = this;
- Drupal.ajax(element_settings);
+ Drupal.ajax(elementSettings);
});
},
};
diff --git a/core/modules/views_ui/js/ajax.js b/core/modules/views_ui/js/ajax.js
index 00024f5..b7b9dcf 100644
--- a/core/modules/views_ui/js/ajax.js
+++ b/core/modules/views_ui/js/ajax.js
@@ -14,19 +14,19 @@
Drupal.AjaxCommands.prototype.viewsSetForm = function (ajax, response, status) {
var $form = $('.js-views-ui-dialog form');
- var $submit_buttons = $form.find('input[type=submit].js-form-submit, button.js-form-submit').once('views-ajax-submit');
- $submit_buttons.on('click mousedown', function () {
+ var $submitButtons = $form.find('input[type=submit].js-form-submit, button.js-form-submit').once('views-ajax-submit');
+ $submitButtons.on('click mousedown', function () {
this.form.clk = this;
});
$form.once('views-ajax-submit').each(function () {
var $form = $(this);
- var element_settings = {
+ var elementSettings = {
url: response.url,
event: 'submit',
base: $form.attr('id'),
element: this
};
- var ajaxForm = Drupal.ajax(element_settings);
+ var ajaxForm = Drupal.ajax(elementSettings);
ajaxForm.$form = $form;
});
};
@@ -75,9 +75,9 @@
$('#views-tabset a').once('views-ajax').on('click', function () {
var href = $(this).attr('href');
- var display_id = href.substr(11);
+ var displayId = href.substr(11);
- $('#views-live-preview #preview-display-id').val(display_id);
+ $('#views-live-preview #preview-display-id').val(displayId);
});
}
};
@@ -85,20 +85,20 @@
Drupal.behaviors.viewsAjax = {
collapseReplaced: false,
attach: function attach(context, settings) {
- var base_element_settings = {
+ var baseElementSettings = {
event: 'click',
progress: { type: 'fullscreen' }
};
$('a.views-ajax-link', context).once('views-ajax').each(function () {
- var element_settings = base_element_settings;
- element_settings.base = $(this).attr('id');
- element_settings.element = this;
+ var elementSettings = baseElementSettings;
+ elementSettings.base = $(this).attr('id');
+ elementSettings.element = this;
if ($(this).attr('href')) {
- element_settings.url = $(this).attr('href');
+ elementSettings.url = $(this).attr('href');
}
- Drupal.ajax(element_settings);
+ Drupal.ajax(elementSettings);
});
$('div#views-live-preview a').once('views-ajax').each(function () {
@@ -106,18 +106,18 @@
return true;
}
- var element_settings = base_element_settings;
+ var elementSettings = baseElementSettings;
- element_settings.url = $(this).attr('href');
- if (Drupal.Views.getPath(element_settings.url).substring(0, 21) !== 'admin/structure/views') {
+ elementSettings.url = $(this).attr('href');
+ if (Drupal.Views.getPath(elementSettings.url).substring(0, 21) !== 'admin/structure/views') {
return true;
}
- element_settings.wrapper = 'views-preview-wrapper';
- element_settings.method = 'replaceWith';
- element_settings.base = $(this).attr('id');
- element_settings.element = this;
- Drupal.ajax(element_settings);
+ elementSettings.wrapper = 'views-preview-wrapper';
+ elementSettings.method = 'replaceWith';
+ elementSettings.base = $(this).attr('id');
+ elementSettings.element = this;
+ Drupal.ajax(elementSettings);
});
$('div#views-live-preview input[type=submit]').once('views-ajax').each(function (event) {
@@ -125,20 +125,20 @@
this.form.clk = this;
return true;
});
- var element_settings = base_element_settings;
+ var elementSettings = baseElementSettings;
- element_settings.url = $(this.form).attr('action');
- if (Drupal.Views.getPath(element_settings.url).substring(0, 21) !== 'admin/structure/views') {
+ elementSettings.url = $(this.form).attr('action');
+ if (Drupal.Views.getPath(elementSettings.url).substring(0, 21) !== 'admin/structure/views') {
return true;
}
- element_settings.wrapper = 'views-preview-wrapper';
- element_settings.method = 'replaceWith';
- element_settings.event = 'click';
- element_settings.base = $(this).attr('id');
- element_settings.element = this;
+ elementSettings.wrapper = 'views-preview-wrapper';
+ elementSettings.method = 'replaceWith';
+ elementSettings.event = 'click';
+ elementSettings.base = $(this).attr('id');
+ elementSettings.element = this;
- Drupal.ajax(element_settings);
+ Drupal.ajax(elementSettings);
});
}
};
diff --git a/core/modules/views_ui/js/views-admin.es6.js b/core/modules/views_ui/js/views-admin.es6.js
index 9866f9f..a3b471f 100644
--- a/core/modules/views_ui/js/views-admin.es6.js
+++ b/core/modules/views_ui/js/views-admin.es6.js
@@ -1134,11 +1134,11 @@
// Closures! :(
const $context = $(context);
const $submit = $context.find('[id^=edit-submit]');
- const old_value = $submit.val();
+ const oldValue = $submit.val();
$submit.once('views-ui-override-button-text')
.on('mouseup', function () {
- $(this).val(old_value);
+ $(this).val(oldValue);
return true;
});
diff --git a/core/modules/views_ui/js/views-admin.js b/core/modules/views_ui/js/views-admin.js
index 032db56..1b175d1 100644
--- a/core/modules/views_ui/js/views-admin.js
+++ b/core/modules/views_ui/js/views-admin.js
@@ -586,10 +586,10 @@
$(context).find('[data-drupal-selector="edit-override-dropdown"]').once('views-ui-override-button-text').each(function () {
var $context = $(context);
var $submit = $context.find('[id^=edit-submit]');
- var old_value = $submit.val();
+ var oldValue = $submit.val();
$submit.once('views-ui-override-button-text').on('mouseup', function () {
- $(this).val(old_value);
+ $(this).val(oldValue);
return true;
});