summaryrefslogtreecommitdiffstats
path: root/sonar-server/src/main/coffee/widgets/word-cloud.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'sonar-server/src/main/coffee/widgets/word-cloud.coffee')
-rw-r--r--sonar-server/src/main/coffee/widgets/word-cloud.coffee11
1 files changed, 10 insertions, 1 deletions
diff --git a/sonar-server/src/main/coffee/widgets/word-cloud.coffee b/sonar-server/src/main/coffee/widgets/word-cloud.coffee
index 21ecefb2ff2..ec1658316b6 100644
--- a/sonar-server/src/main/coffee/widgets/word-cloud.coffee
+++ b/sonar-server/src/main/coffee/widgets/word-cloud.coffee
@@ -21,6 +21,7 @@ window.SonarWidgets.WordCloud = ->
@_legendWidth = window.SonarWidgets.WordCloud.defaults.legendWidth
@_legendMargin = window.SonarWidgets.WordCloud.defaults.legendMargin
@_detailsWidth = window.SonarWidgets.WordCloud.defaults.detailsWidth
+ @_maxResultsReached = false
@_options = {}
@_lineHeight = 20
@@ -35,6 +36,7 @@ window.SonarWidgets.WordCloud = ->
@legendWidth = (_) -> param.call(this, '_legendWidth', _)
@legendMargin = (_) -> param.call(this, '_legendMargin', _)
@detailsWidth = (_) -> param.call(this, '_detailsWidth', _)
+ @maxResultsReached = (_) -> param.call(this, '_maxResultsReached', _)
@options = (_) -> param.call(this, '_options', _)
@
@@ -87,7 +89,14 @@ window.SonarWidgets.WordCloud.prototype.update = ->
@words.sort (a, b) =>
if a.name.toLowerCase() > b.name.toLowerCase() then 1 else -1
- console.log @words
+ # Show maxResultsReached message
+ if @maxResultsReached()
+ @maxResultsReachedLabel.remove() if @maxResultsReachedLabel?
+ @maxResultsReachedLabel = @box.append('div').text @options().maxItemsReachedMessage
+ @maxResultsReachedLabel.style 'color', '#777'
+ @maxResultsReachedLabel.style 'font-size', '12px'
+ @maxResultsReachedLabel.style 'text-align', 'center'
+ @maxResultsReachedLabel.style 'margin-top', '10px'
@words.exit().remove()