Skip to content

Commit

Permalink
Simplified the removal element check on the text centred article type…
Browse files Browse the repository at this point in the history
… editor
  • Loading branch information
PeteOfRepublic committed Sep 11, 2017
1 parent 78cd21c commit 4a07de6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assets/js/textcentred.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var i = 0; // needs to be global
// radio button groups match and then recheck the active state

function iterateInitialFormElements () {
$('.js-align').each(function () {
$('.js-Align').each(function () {
i++;
var name = $(this).find('input').first().attr('name') + i;
$(this).attr('for', name);
Expand All @@ -34,7 +34,7 @@ function checkRadioButtons () {
checkRadioButtons();

function instantiateRemove () {
$('.js-ContentDynamic').find('.js-remove').each(function () {
$('.js-Remove').each(function () {
$(this).on('click', function (e) {
e.preventDefault();
if ($(this).parent().parent().hasClass('temp')) {
Expand Down Expand Up @@ -78,7 +78,7 @@ $('.js-AddImage').on('click', function (e) {
var imgBox = '/editor/fragment/snippetimage';
$(imgEl).load(imgBox, function () {
$(imgEl).appendTo('.js-ContentDynamic');
iterateRadioElements($(this).find('.js-align'));
iterateRadioElements($(this).find('.js-Align'));
instantiateRemove();
});
});

0 comments on commit 4a07de6

Please sign in to comment.