Add form fields to set the colours and the sections for the banner
Add migrations to store the information in the database
This commit is contained in:
@@ -7,6 +7,14 @@ App.Banners =
|
||||
$(selector).removeClass($(selector).attr("class"), true)
|
||||
.addClass(style, true)
|
||||
|
||||
update_background_color: (selector, text_selector, background_color) ->
|
||||
$(selector).css('background-color', background_color);
|
||||
$(text_selector).val(background_color);
|
||||
|
||||
update_font_color: (selector, text_selector, font_color) ->
|
||||
$(selector).css('color', font_color);
|
||||
$(text_selector).val(font_color);
|
||||
|
||||
initialize: ->
|
||||
$('[data-js-banner-title]').on
|
||||
change: ->
|
||||
@@ -23,3 +31,12 @@ App.Banners =
|
||||
$("#banner_image").on
|
||||
change: ->
|
||||
App.Banners.update_style("#js-banner-image", $(this).val())
|
||||
|
||||
$("#banner_background_color_picker").on
|
||||
change: ->
|
||||
App.Banners.update_background_color("#js-banner-style", "#banner_background_color", $(this).val());
|
||||
|
||||
$("#banner_font_color_picker").on
|
||||
change: ->
|
||||
App.Banners.update_font_color("#js-banner-title", "#banner_font_color", $(this).val());
|
||||
App.Banners.update_font_color("#js-banner-description", "#banner_font_color", $(this).val());
|
||||
|
||||
Reference in New Issue
Block a user