Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'My current jam is' text label a customisable option #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion medallion.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ Jam.Medallion.prototype.imageSize = function() {
return this.getOption('imageSize', 'small');
};

Jam.Medallion.prototype.textLabel = function() {
return this.getOption('textLabel', 'My current jam is: ');
};



Jam.Medallion.prototype.setJSON = function(json) {
this.json = json;
};
Expand Down Expand Up @@ -190,9 +196,10 @@ Jam.Medallion.prototype.createImageElement = function() {
};

Jam.Medallion.prototype.createTextElement = function() {
var textLabel = this.textLabel();
var textElement = document.createElement('p');
textElement.className = 'jam-text';
textElement.innerHTML = Jam.escapeHTML('My current jam is ');
textElement.innerHTML = Jam.escapeHTML(textLabel+" ");

var linkElement = this.createLinkElement('text');
linkElement.innerHTML += '“' + Jam.escapeHTML(this.json.jam.title) + '”';
Expand Down