From d38a2668299da91f3ed645924ce0e3db0ad625cf Mon Sep 17 00:00:00 2001 From: Tony Li Date: Fri, 19 Jun 2015 20:32:42 -0700 Subject: [PATCH] option to search using Capitals --- src/DebugBar/Resources/widgets.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/DebugBar/Resources/widgets.js b/src/DebugBar/Resources/widgets.js index 6a2120a..5e54c57 100644 --- a/src/DebugBar/Resources/widgets.js +++ b/src/DebugBar/Resources/widgets.js @@ -319,11 +319,18 @@ if (typeof(PhpDebugBar) == 'undefined') { this.bindAttr(['exclude', 'search'], function() { var data = this.get('data'), exclude = this.get('exclude'), - search = this.get('search').toLowerCase(), + search = this.get('search'), + caseless = false, fdata = []; + if (search && search === search.toLowerCase()) { + caseless = true; + } + for (var i = 0; i < data.length; i++) { - if ((!data[i].label || $.inArray(data[i].label, exclude) === -1) && (!search || data[i].message.toLowerCase().indexOf(search) > -1)) { + var message = caseless ? data[i].message.toLowerCase() : data[i].message; + + if ((!data[i].label || $.inArray(data[i].label, exclude) === -1) && (!search || message.indexOf(search) > -1)) { fdata.push(data[i]); } }