Skip to content

Commit

Permalink
fix minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
LuizArmesto committed Oct 28, 2014
1 parent a8a255f commit 826d44a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: git://github.com/it3s/meppit-map-rails.git
revision: 652be84ee87f5ce1d53866c9574278d53450db10
revision: e91cb7605515395ab692b5cf6bdbfd95f65719d6
specs:
meppit-map-rails (0.2.0)
coffee-rails
Expand Down
6 changes: 3 additions & 3 deletions app/assets/javascripts/components/colorPicker.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ App.components.colorPicker = ->
@onChange color if @getValue() isnt color

onFieldChange: ->
@onChange @fieldEl.val()
@onChange @fieldEl.val() if @getValue() isnt @fieldEl.val()

onChange: (color) ->
@setValue color
@_triggerFieldChange ?= _.debounce () -> @fieldEl?.trigger 'change', 100
@_triggerFieldChange()
@fieldEl?.val @getValue()
@fieldEl?.trigger 'change'
App.mediator.publish 'colorpicker:changed', color

update: ->
Expand Down
32 changes: 16 additions & 16 deletions app/assets/javascripts/components/editLayers.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -29,22 +29,6 @@ DataForm = ->
onChange: ->
App.mediator.publish 'layerData:changed', @index

_getRule: ->
tags = @fields['tags'].val()
if tags.length > 0
{
operator: 'has'
property: 'tags'
value: tags.split(',')
}
else
null

_setRule: (rule) ->
if rule? and rule.operator == 'has' and rule.property == 'tags' and rule.value?
value = JSON.parse(rule.value).join(',')
@fields['tags'].setComponentValue('tags', value)

getValue: ->
vals = {}
_.each @_params, (key) =>
Expand All @@ -70,6 +54,22 @@ DataForm = ->
_.each @fields, (el, key) =>
el.change _.debounce(@onChange.bind(this), 100)

_getRule: ->
tags = @fields['tags'].val()
if tags.length > 0
{
operator: 'has'
property: 'tags'
value: tags.split(',')
}
else
null

_setRule: (rule) ->
if rule? and rule.operator == 'has' and rule.property == 'tags' and rule.value?
value = JSON.parse(rule.value).join(',')
@fields['tags'].setComponentValue('tags', value)


LayerItem = ->
template: JST['templates/layerItem']
Expand Down
2 changes: 1 addition & 1 deletion app/assets/javascripts/components/map.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ App.components.map = ->
height: @container.css('height')
width: @container.css('width')
'z-index': @container.css('z-index')
@map.zoomIn 2, animate: false
top = $("#header").height()
$(window).scrollTop(0)
@container.css
Expand All @@ -228,7 +229,6 @@ App.components.map = ->
height: $(window).height() - top
width: $(window).width()
'z-index': 9
@map.zoomIn 2, animate: false
@map.refresh()
@expanded = true

Expand Down
4 changes: 2 additions & 2 deletions app/models/concerns/layers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def layers
end

def layers_values
layers.map do |l|
(layers.map do |l|
{
id: l.id,
name: l.name,
Expand All @@ -21,7 +21,7 @@ def layers_values
position: l.position,
rule: l.rule,
}
end
end).sort_by { |layer| layer[:position] }
end

def save_layers_from_attributes
Expand Down

0 comments on commit 826d44a

Please sign in to comment.