@flourish/footer
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -33,3 +33,7 @@ (function (global, factory) { | ||
function createFooter(el) { | ||
function createFooter(el, project_state) { | ||
state = project_state; | ||
appendState(); | ||
footer_el = document.createElement("div"); | ||
@@ -58,4 +62,11 @@ footer_el.className = "flourish-footer"; | ||
function updateFooter(new_state) { | ||
state = new_state; | ||
function appendState() { | ||
for (key in FOOTER_DEFAULTS) { | ||
if (!state[key]) { | ||
state[key] = FOOTER_DEFAULTS[key]; | ||
} | ||
} | ||
} | ||
function updateFooter() { | ||
var sources = [ | ||
@@ -62,0 +73,0 @@ { name: state.footer_source_name, url: state.footer_source_url }, |
{ | ||
"name": "@flourish/footer", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Add footer", | ||
@@ -5,0 +5,0 @@ "main": "footer.js", |
# Flourish footer | ||
This is just a very first version of a footer component. For now just a central place to store generic settings and styles for title and subtitle. | ||
Let's you add sources and notes to your visualisations. | ||
## Install | ||
`npm install @flourish/footer` | ||
## Usage | ||
There are 3 functions | ||
`createFooter(target_el)` appends a div in the target element, and adds footer state properties | ||
`updateFooter()` updates the footer contents and styles | ||
`getFooterHeight()` returns the total footer height (including margins) | ||
@@ -25,3 +25,7 @@ var footer_el, source_el, note_el; | ||
function createFooter(el) { | ||
function createFooter(el, project_state) { | ||
state = project_state; | ||
appendState(); | ||
footer_el = document.createElement("div"); | ||
@@ -50,4 +54,11 @@ footer_el.className = "flourish-footer"; | ||
function updateFooter(new_state) { | ||
state = new_state; | ||
function appendState() { | ||
for (key in FOOTER_DEFAULTS) { | ||
if (!state[key]) { | ||
state[key] = FOOTER_DEFAULTS[key]; | ||
} | ||
} | ||
} | ||
function updateFooter() { | ||
var sources = [ | ||
@@ -54,0 +65,0 @@ { name: state.footer_source_name, url: state.footer_source_url }, |
11908
15
7