From aaef2d4362f60123ce93422a4a09c031e280504d Mon Sep 17 00:00:00 2001 From: Raphael Beer Date: Wed, 20 Apr 2016 09:34:20 +0200 Subject: [PATCH] Use modal Element as traversing root --- public/src/modules/iconSelect.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/src/modules/iconSelect.js b/public/src/modules/iconSelect.js index d9ab54e67d..252f8778d9 100644 --- a/public/src/modules/iconSelect.js +++ b/public/src/modules/iconSelect.js @@ -58,15 +58,15 @@ define('iconSelect', function() { submitEl = modalEl.find('button.btn-primary'); function changeSelection(newSelection) { - $('.icon-container i.selected').removeClass('selected'); + modalEl.find('i.selected').removeClass('selected'); if (newSelection) { newSelection.addClass('selected'); } else if (searchEl.val().length === 0) { if (selected) { - $('.icon-container .' + selected).addClass('selected'); + modalEl.find('.' + selected).addClass('selected'); } } else { - $('.icon-container i:visible').first().addClass('selected'); + modalEl.find('i:visible').first().addClass('selected'); } } @@ -74,7 +74,7 @@ define('iconSelect', function() { searchEl.focus(); if (selected) { - modalEl.find('.icon-container .' + selected).addClass('selected'); + modalEl.find('.' + selected).addClass('selected'); } modalEl.find('.icon-container').on('click', 'i', function() {