else
scrollOffset = 0
- if firstPage
- @layout.showSpinner 'resultsRegion'
- #else
- # @layout.showSpinner 'resultsRegion'
+ @layout.showSpinner 'resultsRegion'
@layout.showSpinner 'facetsRegion' unless fromFacets || !firstPage
+
+
jQuery.ajax
url: "#{baseUrl}/api/rules/search"
data: fetchQuery
pageIndex: r.p
pageSize: r.ps
pages: 1 + (r.total / r.ps)
+
+ if @codingRulesListView
+ @codingRulesListView.close()
+
if firstPage
@codingRules.reset r.rules
@codingRulesListView = new CodingRulesListView
app: @
collection: @codingRules
- @layout.resultsRegion.show @codingRulesListView
else
@codingRulesListView.unbindEvents()
@codingRules.add r.rules
- @codingRulesListView.render()
+
+ @layout.resultsRegion.show @codingRulesListView
+
if @codingRules.isEmpty()
@layout.detailsRegion.reset()
class AppLayout extends Marionette.Layout
className: 'navigator coding-rules-navigator'
template: Templates['coding-rules-layout']
- spinner: '<i class="spinner"></i>'
storageKey: 'codingRulesResultsWidth'
showSpinner: (region) ->
- @$(@[region].el).html @spinner
+ @[region].show new Marionette.ItemView
+ template: _.template('<i class="spinner"></i>')
startResize: (e) ->
onRender: ->
- key 'up', 'list', => @selectPrev()
- key 'down', 'list', => @selectNext()
+ key 'up', 'list', (e) =>
+ @selectPrev()
+ #e.stopPropagation()
+ key 'down', 'list', (e) =>
+ @selectNext()
+ #e.stopPropagation()
$scrollEl = jQuery('.navigator-results')
scrollEl = $scrollEl.get(0)
$scrollEl.off('scroll').on 'scroll', throttledScroll
- close: ->
- @unbindEvents
- super
+ onClose: ->
+ @unbindEvents()
unbindEvents: ->
key.unbind 'up', 'list'
key.unbind 'down', 'list'
- scrollEl = jQuery '.navigator-results'
- scrollEl.off 'scroll';
selectIssue: (el, open) ->