Use modal Element as traversing root

v1.18.x
Raphael Beer 9 years ago
parent ff2ca0f786
commit aaef2d4362

@ -58,15 +58,15 @@ define('iconSelect', function() {
submitEl = modalEl.find('button.btn-primary'); submitEl = modalEl.find('button.btn-primary');
function changeSelection(newSelection) { function changeSelection(newSelection) {
$('.icon-container i.selected').removeClass('selected'); modalEl.find('i.selected').removeClass('selected');
if (newSelection) { if (newSelection) {
newSelection.addClass('selected'); newSelection.addClass('selected');
} else if (searchEl.val().length === 0) { } else if (searchEl.val().length === 0) {
if (selected) { if (selected) {
$('.icon-container .' + selected).addClass('selected'); modalEl.find('.' + selected).addClass('selected');
} }
} else { } else {
$('.icon-container i:visible').first().addClass('selected'); modalEl.find('i:visible').first().addClass('selected');
} }
} }
@ -74,7 +74,7 @@ define('iconSelect', function() {
searchEl.focus(); searchEl.focus();
if (selected) { if (selected) {
modalEl.find('.icon-container .' + selected).addClass('selected'); modalEl.find('.' + selected).addClass('selected');
} }
modalEl.find('.icon-container').on('click', 'i', function() { modalEl.find('.icon-container').on('click', 'i', function() {

Loading…
Cancel
Save