diff --git a/app/assets/javascripts/admin/commons/batch_selectable.js b/app/assets/javascripts/admin/commons/batch_selectable.js index 24d954826cc31c9de41dc7a56129be4a6aa656b9..4136293da4a891f642c44d3244037d84881407d1 100644 --- a/app/assets/javascripts/admin/commons/batch_selectable.js +++ b/app/assets/javascripts/admin/commons/batch_selectable.js @@ -17,11 +17,16 @@ window.osuny.BatchSelectable.prototype.initEvents = function () { } if (this.actionsContainer !== null) { for (i = 0; i < this.selectSingleInputs.length; i += 1) { - this.selectSingleInputs[i].addEventListener('change', this.toggleActionsContainer.bind(this)); + this.initSingleInputEvent(this.selectSingleInputs[i]); } } }; +window.osuny.BatchSelectable.prototype.initSingleInputEvent = function (input) { + 'use strict'; + input.addEventListener('change', this.toggleActionsContainer.bind(this)); +}; + window.osuny.BatchSelectable.prototype.toggleSingleInputs = function (event) { 'use strict'; var checked = event.currentTarget.checked, diff --git a/app/assets/javascripts/admin/communication/websites.js b/app/assets/javascripts/admin/communication/websites.js index 5249436f0baf83e7d02d27ee6420dd54989d13f0..9f223d1c278c60f89cd2164ffa964d75723e55cf 100644 --- a/app/assets/javascripts/admin/communication/websites.js +++ b/app/assets/javascripts/admin/communication/websites.js @@ -1,4 +1,3 @@ -/* global $ */ window.osuny.communication.websites = { init: function () { 'use strict'; @@ -14,7 +13,7 @@ window.osuny.communication.websites = { initEvents: function () { 'use strict'; var i; - for (i = 0 ; i < this.languagesCheckboxes.length ; i += 1) { + for (i = 0; i < this.languagesCheckboxes.length; i += 1) { this.languagesCheckboxes[i].addEventListener('change', this.onChangeCheckbox.bind(this)); } }, @@ -26,13 +25,13 @@ window.osuny.communication.websites = { i; // Clean options - this.defaultLanguageSelect.innerHTML = ""; + this.defaultLanguageSelect.innerHTML = ''; // Re-hydrate options for (i = 0; i < this.defaultLanguageOptions.length; i += 1) { languageOption = this.defaultLanguageOptions[i]; - languageCheckbox = document.querySelector('.js-languages input[type="checkbox"][value="' + languageOption.value + '"]') - if (languageOption.value === "" || languageCheckbox.checked) { + languageCheckbox = document.querySelector('.js-languages input[type="checkbox"][value="' + languageOption.value + '"]'); + if (languageOption.value === '' || languageCheckbox.checked) { this.defaultLanguageSelect.appendChild(languageOption); } }