Admin option to add banners and show banners
This commit is contained in:
@@ -23,6 +23,8 @@ App.AdvancedSearch =
|
||||
$('.js-calendar').datepicker
|
||||
regional: locale
|
||||
maxDate: "+0d"
|
||||
$('.js-calendar-full').datepicker
|
||||
regional: locale
|
||||
|
||||
initialize: ->
|
||||
App.AdvancedSearch.init_calendar()
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
//= require tracks
|
||||
//= require valuation_spending_proposal_form
|
||||
//= require embed_video
|
||||
//= require banners
|
||||
|
||||
var initialize_modules = function() {
|
||||
App.Comments.initialize();
|
||||
@@ -63,6 +64,7 @@ var initialize_modules = function() {
|
||||
App.Tracks.initialize();
|
||||
App.ValuationSpendingProposalForm.initialize();
|
||||
App.EmbedVideo.initialize();
|
||||
App.Banners.initialize();
|
||||
};
|
||||
|
||||
$(function(){
|
||||
|
||||
25
app/assets/javascripts/banners.js.coffee
Normal file
25
app/assets/javascripts/banners.js.coffee
Normal file
@@ -0,0 +1,25 @@
|
||||
App.Banners =
|
||||
|
||||
update_banner: (selector, text) ->
|
||||
$(selector).html(text)
|
||||
|
||||
update_style: (selector, style) ->
|
||||
$(selector).removeClass($(selector).attr("class"), true)
|
||||
.addClass(style, true)
|
||||
|
||||
initialize: ->
|
||||
$('[data-js-banner-title]').on
|
||||
change: ->
|
||||
App.Banners.update_banner("#js-banner-title", $(this).val())
|
||||
|
||||
$('[data-js-banner-description]').on
|
||||
change: ->
|
||||
App.Banners.update_banner("#js-banner-description", $(this).val())
|
||||
|
||||
$("#banner_style").on
|
||||
change: ->
|
||||
App.Banners.update_style("#js-banner-style", $(this).val())
|
||||
|
||||
$("#banner_image").on
|
||||
change: ->
|
||||
App.Banners.update_style("#js-banner-image", $(this).val())
|
||||
Reference in New Issue
Block a user