diff options
Diffstat (limited to 'server/sonar-web/src/main/js/apps/api-documentation/search-view.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/api-documentation/search-view.js | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/server/sonar-web/src/main/js/apps/api-documentation/search-view.js b/server/sonar-web/src/main/js/apps/api-documentation/search-view.js index a24d9390bb2..1635d8a2abf 100644 --- a/server/sonar-web/src/main/js/apps/api-documentation/search-view.js +++ b/server/sonar-web/src/main/js/apps/api-documentation/search-view.js @@ -1,36 +1,36 @@ -define([ - './templates' -], function () { - - return Marionette.ItemView.extend({ - template: Templates['api-documentation-search'], - - ui: { - input: '.search-box-input' - }, - - events: { - 'keyup @ui.input': 'onChange', - 'search @ui.input': 'onChange' - }, - - initialize: function () { - this.query = ''; - this.debouncedFilter = _.debounce(this.filter, 250); - }, - - onChange: function () { - var query = this.ui.input.val(); - if (query === this.query) { - return; - } - this.query = this.ui.input.val(); - this.debouncedFilter(query); - }, - - filter: function (query) { - this.options.state.set({ query: query }); +import _ from 'underscore'; +import Marionette from 'backbone.marionette'; +import './templates'; + +export default Marionette.ItemView.extend({ + template: Templates['api-documentation-search'], + + ui: { + input: '.search-box-input' + }, + + events: { + 'keyup @ui.input': 'onChange', + 'search @ui.input': 'onChange' + }, + + initialize: function () { + this.query = ''; + this.debouncedFilter = _.debounce(this.filter, 250); + }, + + onChange: function () { + var query = this.ui.input.val(); + if (query === this.query) { + return; } - }); + this.query = this.ui.input.val(); + this.debouncedFilter(query); + }, + filter: function (query) { + this.options.state.set({ query: query }); + } }); + + |