Skip to content

Commit

Permalink
Implement code highlight toggle from quick settings in element
Browse files Browse the repository at this point in the history
  • Loading branch information
abe33 committed Dec 18, 2014
1 parent 9af0bd1 commit c779f6f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/minimap-element.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,9 @@ class MinimapElement extends HTMLElement

@minimap

setDisplayCodeHighlights: (@displayCodeHighlights) ->
@requestForcedUpdate() if @attached

initializeContent: ->
@initializeCanvas()

Expand Down
13 changes: 12 additions & 1 deletion spec/minimap-element-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ path = require 'path'
{TextEditor} = require 'atom'
Minimap = require '../lib/minimap'
MinimapElement = require '../lib/minimap-element'
{click} = require './helpers/events'
{click, mousedown} = require './helpers/events'
stylesheetPath = path.resolve __dirname, '..', 'stylesheets', 'minimap.less'
stylesheet = atom.themes.loadStylesheet(stylesheetPath)

Expand Down Expand Up @@ -478,6 +478,17 @@ describe 'MinimapElement', ->

quickSettingsView = workspaceElement.querySelector('.minimap-quick-settings')

describe 'clicking on the code highlight item', ->
beforeEach ->
item = quickSettingsView.querySelector('li:last-child')
mousedown(item)

it 'toggles the code highlights on the minimap element', ->
expect(minimapElement.displayCodeHighlights).toBeTruthy()

it 'requests an update', ->
expect(minimapElement.frameRequested).toBeTruthy()

describe 'clicking on the open settings button again', ->
beforeEach ->
click(openQuickSettings)
Expand Down

0 comments on commit c779f6f

Please sign in to comment.