RAVE-1272 | Check the type of the event to determine if it was a key press or a 
click instead of only relying on "which".


Project: http://git-wip-us.apache.org/repos/asf/rave/repo
Commit: http://git-wip-us.apache.org/repos/asf/rave/commit/2736abf1
Tree: http://git-wip-us.apache.org/repos/asf/rave/tree/2736abf1
Diff: http://git-wip-us.apache.org/repos/asf/rave/diff/2736abf1

Branch: refs/heads/master
Commit: 2736abf1c096962fef766d206ddb0d9257267516
Parents: aab1719
Author: Stanton Sievers <[email protected]>
Authored: Mon Aug 11 11:31:25 2014 -0400
Committer: Stanton Sievers <[email protected]>
Committed: Mon Aug 11 11:31:25 2014 -0400

----------------------------------------------------------------------
 .../src/main/webapp/static/script/portal/rave_ui.js              | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/rave/blob/2736abf1/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
----------------------------------------------------------------------
diff --git 
a/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js 
b/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
index 61bb950..ddf6fcd 100644
--- a/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
+++ b/rave-portal-resources/src/main/webapp/static/script/portal/rave_ui.js
@@ -100,7 +100,7 @@ define(["jquery", "underscore", "rave",
 
                 search: function (e) {
                     //allow search function to trigger from enter keypress or 
button click
-                    if (e.which == 13 || _.isUndefined(e.which)) {
+                    if ((e.type == 'keypress' && e.which == 13) || e.type == 
'click') {
                         var term = $('#searchTerm', this.$el).val();
 
                         this.models.users.filter(term);
@@ -133,7 +133,7 @@ define(["jquery", "underscore", "rave",
                         'editor:add': '',
                         'editor:remove': '',
                         'clone': 'success.clone.page'
-                    }
+                    };
 
                     var msg = eventsToMessages[event];
 

Reply via email to