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:
iagirre
2018-01-09 17:30:11 +01:00
committed by Angel Perez
parent 3e4d095e6f
commit 6d6da8affc
11 changed files with 106 additions and 12 deletions

View File

@@ -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());