aboutsummaryrefslogtreecommitdiff
path: root/javascript/app/controllers
diff options
context:
space:
mode:
authoralexwl <alexey.a.kiryushin@gmail.com>2019-02-06 21:42:29 +0300
committeralexwl <alexey.a.kiryushin@gmail.com>2019-02-06 21:42:29 +0300
commitd6a64db1ced3d3577886a7aec140a5174cbceb48 (patch)
tree88a6535043547da7093c126df642770533a4ab71 /javascript/app/controllers
parentb796d370c6b7ec7452a37440b089fd45853a47f4 (diff)
Add identifier search in all indexed packages
Diffstat (limited to 'javascript/app/controllers')
-rw-r--r--javascript/app/controllers/packages.js19
-rw-r--r--javascript/app/controllers/search.js28
2 files changed, 46 insertions, 1 deletions
diff --git a/javascript/app/controllers/packages.js b/javascript/app/controllers/packages.js
index a1724dd..614ecd8 100644
--- a/javascript/app/controllers/packages.js
+++ b/javascript/app/controllers/packages.js
@@ -1,4 +1,6 @@
import Ember from 'ember';
+import {goToDefinition} from '../utils/go-to-definition';
+
export default Ember.Controller.extend({
queryObserver : Ember.observer("query",function() {
Ember.run.debounce(this, () => {
@@ -8,5 +10,20 @@ export default Ember.Controller.extend({
this.set('packages',packages);
});
}, 300);
- })
+ }),
+ actions: {
+ 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;
+ }
+ }
});
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;
+ }
+ }
+});