Merge branch 'legislation-module-stable' into 107-social-share-for-annotations
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
//= require markdown-it
|
||||
//= require markdown_editor
|
||||
//= require cocoon
|
||||
//= require legislation_admin
|
||||
//= require legislation
|
||||
//= require legislation_allegations
|
||||
//= require legislation_annotatable
|
||||
@@ -83,6 +84,7 @@ var initialize_modules = function() {
|
||||
App.Banners.initialize();
|
||||
App.SocialShare.initialize();
|
||||
App.MarkdownEditor.initialize();
|
||||
App.LegislationAdmin.initialize();
|
||||
App.LegislationAllegations.initialize();
|
||||
App.Legislation.initialize();
|
||||
if ( $(".legislation-annotatable").length )
|
||||
|
||||
14
app/assets/javascripts/legislation_admin.js.coffee
Normal file
14
app/assets/javascripts/legislation_admin.js.coffee
Normal file
@@ -0,0 +1,14 @@
|
||||
App.LegislationAdmin =
|
||||
|
||||
initialize: ->
|
||||
$("input[type='checkbox'][data-disable-date]").on
|
||||
change: ->
|
||||
checkbox = $(this)
|
||||
parent = $(this).parents('.row:eq(0)')
|
||||
date_selector = $(this).data('disable-date')
|
||||
parent.find("input[type='text'][id^='"+date_selector+"']").each ->
|
||||
if checkbox.is(':checked')
|
||||
$(this).removeAttr("disabled")
|
||||
else
|
||||
$(this).val("")
|
||||
|
||||
@@ -56,7 +56,14 @@ App.LegislationAnnotatable =
|
||||
return
|
||||
|
||||
$('[data-annotation-id]').removeClass('current-annotation')
|
||||
$(this).addClass('current-annotation')
|
||||
|
||||
parent = $(this).parents('[data-annotation-id]:eq(0)')
|
||||
if parent.length
|
||||
target = parent
|
||||
else
|
||||
target = $(this)
|
||||
annotation_id = target.data('annotation-id')
|
||||
$('[data-annotation-id="'+annotation_id+'"]').addClass('current-annotation')
|
||||
|
||||
App.LegislationAllegations.show_comments()
|
||||
$("#comments-box").show()
|
||||
|
||||
Reference in New Issue
Block a user