Skip to content

Commit

Permalink
demo card with image
Browse files Browse the repository at this point in the history
  • Loading branch information
bantic committed Nov 9, 2015
1 parent 391878e commit 2a7753a
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 2 deletions.
10 changes: 10 additions & 0 deletions demo/app/mobiledoc-cards/image.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
export let imageCard = {
name: 'image-card',
display: {
setup(element) {
var card = document.createElement('img');
card.src = 'http://placehold.it/200x75';
element.appendChild(card);
}
}
};
7 changes: 5 additions & 2 deletions demo/app/mobiledoc-cards/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import { inputCard } from './input';
import { simpleCard } from './simple';
import { selfieCard } from './selfie';
import { imageCard } from './image';

export let cardsList = [
inputCard,
simpleCard,
selfieCard
selfieCard,
imageCard
];

export let cardsHash = {
['input-card']: inputCard,
['simple-card']: simpleCard,
['selfie-card']: selfieCard
['selfie-card']: selfieCard,
['image-card']: imageCard
};
11 changes: 11 additions & 0 deletions demo/app/mobiledocs/image-card.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
export let imageCard = {
version: '0.2.0',
sections: [
[],
[
[1, 'p', [[[], 0, 'before']]],
[10, 'image-card'],
[1, 'p', [[[], 0, 'after']]]
]
]
};
1 change: 1 addition & 0 deletions demo/app/mobiledocs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { simpleList } from './simple-list';
export { simpleCard } from './simple-card';
export { inputCard } from './input-card';
export { selfieCard } from './selfie-card';
export { imageCard } from './image-card';
1 change: 1 addition & 0 deletions demo/app/templates/index.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
<option value='empty'>Empty mobiledoc</option>
<option value='simpleList'>List example</option>
<option value='simpleCard'>Simple Card</option>
<option value='imageCard'>Image Card</option>
<option value='inputCard'>Card with Input</option>
<option value='selfieCard'>Selfie Card</option>
</select>
Expand Down

0 comments on commit 2a7753a

Please sign in to comment.