Skip to content
This repository has been archived by the owner on Feb 7, 2019. It is now read-only.

x-card should support a "src" attribute #165

Closed
cfjedimaster opened this issue Apr 16, 2014 · 7 comments
Closed

x-card should support a "src" attribute #165

cfjedimaster opened this issue Apr 16, 2014 · 7 comments
Milestone

Comments

@cfjedimaster
Copy link

It would be cool if x-card could be sourced via XHR. So for example:

<x-deck>
    <x-card transition-type="slide-right" src="card1.html"></x-card>
    <x-card transition-type="slide-left" src="card2.html"></x-card>
    <x-card transition-type="fade-scale">2<span>I'm just inline.</span></x-card>
@pennyfx
Copy link
Contributor

pennyfx commented Apr 16, 2014

We have a panel that does that.

https://github.com/x-tag/panel

You can download it here.

http://x-tags.org/download

@cfjedimaster
Copy link
Author

Would that work as a drop in replacement for x-card? That would be cool. :)

@pennyfx
Copy link
Contributor

pennyfx commented Apr 16, 2014

You'll have to nest them like so:

<x-card>
  <x-panel src="page1.html"></x-panel>
</x-card>

@cfjedimaster
Copy link
Author

I'm speaking hypothetical now - but I wonder if x-deck could be updated to
allow any block style tag.

On Wed, Apr 16, 2014 at 4:24 PM, Arron Schaar notifications@github.comwrote:

You'll have to nest them like so:


Reply to this email directly or view it on GitHubhttps://github.com//issues/165#issuecomment-40654226
.

Raymond Camden, Web Developer for Adobe

Email : raymondcamden@gmail.com
Blog : www.raymondcamden.com
Twitter: raymondcamden

@pennyfx
Copy link
Contributor

pennyfx commented Apr 16, 2014

The cards have some special functionality, so it's not possible to use any block element.
https://github.com/x-tag/deck/blob/master/src/deck.js#L143

However, hypothetically, you can create a new custom element that extends from x-card and add any special functionality you want.

For example:

xtag.register('x-super-card', {
  mixins: ['request'],
  extends: 'x-card'
});

In this sample, I'm using the same request mixin that is used in x-panel and extending from an x-card. The request mixin is called x-tag-mixin-request in Bower.
http://x-tags.org/docs#custom-tag-registration-mixins

I reviewed our x-deck code and it looks like it is hard coded to look for x-card in a few places so that's not good. I'll create a bug to improve the deck to make it more extensible, so this way of extending elements would work.

@potch
Copy link
Member

potch commented Jul 15, 2014

The goal in Brick 2.0 will be to allow any element to be a 'card' in a deck and remove the need for a specific card element. Right now this is not yet the case, so leaving this bug open to track.

@dotch
Copy link

dotch commented Jul 18, 2014

will be tracked in mozbrick/brick-deck#6

@dotch dotch closed this as completed Jul 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants