New approach for allegation toggle (needs review)

This commit is contained in:
Martín González
2016-12-22 16:33:26 +01:00
parent 294d216ac1
commit 8065b4d2f7
2 changed files with 14 additions and 11 deletions

View File

@@ -3,14 +3,17 @@ App.Allegations =
toggle_comments: ->
$('.draft-allegation').toggleClass('comments-on');
toggle_index: ->
$('.draft-allegation').toggleClass('comments-on');
initialize: ->
$('#js-toggle-allegation-comments').on
click: ->
App.Allegations.toggle_comments()
$('.js-toggle-allegations .draft-panel').on
click: ->
console.log("panel")
App.Allegations.toggle_comments()
$('#js-toggle-allegation-index').on
click: ->
App.Allegations.toggle_index()
$('.js-toggle-allegations').on
click: ->
console.log("column")
if $('.draft-allegation').hasClass('comments-on')
console.log("comments-on")
return false
else
App.Allegations.toggle_comments()

View File

@@ -43,7 +43,7 @@
</div>
<div class="row draft-allegation medium-collapse">
<div id="js-toggle-allegation-index" class="small-12 calc-index column border-right">
<div class="small-12 calc-index column border-right js-toggle-allegations">
<div class="draft-panel">
<div>
<span class="icon-banner" aria-hidden="true"></span> <span class="panel-title">Índice</span>
@@ -180,7 +180,7 @@
</div>
</div>
<div id="js-toggle-allegation-comments" class="small-12 calc-comments end column">
<div class="small-12 calc-comments end column js-toggle-allegations">
<div class="draft-panel">
<div>
<span class="icon-comments" aria-hidden="true"></span> <span class="panel-title">Comentarios</span>