aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/controllers/search.js
diff options
context:
space:
mode:
Diffstat (limited to 'javascript/app/controllers/search.js')
-rw-r--r--javascript/app/controllers/search.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/javascript/app/controllers/search.js b/javascript/app/controllers/search.js
new file mode 100644
index 0000000..5d77770
--- /dev/null
+++ b/javascript/app/controllers/search.js
@@ -0,0 +1,28 @@
+import Ember from 'ember';
+import {goToDefinition} from '../utils/go-to-definition';
+
+export default Ember.Controller.extend({
+ store : Ember.inject.service('store'),
+ actions : {
+ goToDefinition (locationInfo,event) {
+ goToDefinition(this.get('store'),
+ locationInfo,
+ event.which,
+ null);
+ return false;
+ },
+ searchIdentifier (query) {
+ if(query) {
+ document.title = "Haskell code explorer";
+ this.transitionToRoute('search',query);
+ }
+ },
+ showIdentifier (identifierInfo) {
+ goToDefinition(this.get('store'),
+ identifierInfo.locationInfo,
+ 1,//left mouse button
+ null);
+ return false;
+ }
+ }
+});