minutebase / ember-portal Goto Github PK
View Code? Open in Web Editor NEWRender stuff here, put it over there
Home Page: http://minutebase.github.io/ember-portal
License: MIT License
Render stuff here, put it over there
Home Page: http://minutebase.github.io/ember-portal
License: MIT License
Hi there,
We noticed that your repo has a high severity vulnerability:
Here is the test report for this repo.
If you’d like to fix this vulnerability, Snyk lets you generate a pull request that recommends the best upgrade path - there’s a link to fix this vulnerability on the test report.
Stay secure :-)
Snyk Community
Leaves divs in body tag after use
Consider changing the code at:
https://github.com/minutebase/ember-portal/blob/master/addon/components/portal-for.js#L9
to something like:
'portal-tag-name': 'div',
portalElement() {
const elementID = portalIdForName(this.get("name"));
let element = document.getElementById(elementID);
if (!element) {
element = document.createElement(this.get('portal-tag-name'));
element.id = elementID;
}
return element;
},
This will allow users to customize the element tag name of the created portal, which is particularly useful for yielding into lists, spans, and other such elements
Getting this in the console since upgrading from ember 2.16.0 to 2.18.2:
DEPRECATION: Importing from the `ember-component` module has been deprecated. Please use the new module imports:
import Component from '@ember/component'
[deprecation id: ember-cli-shims.deprecated-shims] See https://github.com/emberjs/rfcs/blob/master/text/0176-javascript-module-api.md for more details.
A quick grep of my node_modules
reveals ember-portal
is the only addon doing this.
Ember-Wormhole has something like this, would also be super useful here.
-content
and -for
don't immediately resonate with which side of the wormhole is represented.
how about something like portal-input
and portal-output
?
Ember version: 2.4.0-beta.1+56f3e0ac
I'm trying a simple example:
{{! app/components/some-component.hbs }}
<div id="nested-structure">
{{custom-component}}
</div>
{{portal-for name="footer"}}
{{! app/components/custom-component.hbs }}
{{#portal-content for="footer"}}
foo
{{/portal-content}}
It seems exports.default._emberMetalMixin.Mixin.create._Mixin$create.init
is complaining about ember-wormhole's custom render function.
Hi folks,
Using Ember 2.13.4 and v0.1.0 of this library.
I'm trying to set up my application's navbar so that it displays default content for most of the application's routes, but can occasionally be overridden.
To do this, in my application.hbs
template, I have a {{#portal-for name='navbar'}}
, and in the same template I have a {{#portal-content for='navbar'}}
that renders the default contents for the application.
In a child route where I want to customize the navbar's content, I have another {{#portal-content for='navbar'}}
block. When I load the application from the index
route, and navigate to the child route, the navbar's contents are replaced as expected. Going back to the index
route restores the default content from the application.hbs
, as index.hbs
template doesn't have a custom portal.
However, when I load the application directly from the child route, the wormhole displays the default content from the application.hbs
template. Navigating to index
, and then back to the child route fixes the problem.
I see several deprecation warnings in the console:
Importing from the `ember-component` module has been deprecated.
Importing from the `ember-service/inject` module has been deprecated.
Importing from the `ember-computed` module has been deprecated.
Importing from the `ember-service` module has been deprecated.
Importing from the `ember-runloop` module has been deprecated.
In previous versions of Ember (2.4.x with version 0.0.5 of this add-on), the method I've described above has worked for me. Is this something a simple hot fix can address, or has the addon changed since it hit 0.1.0?
Please advise, and thanks for this fantastic addon. It's saved me so much time and spared me so many headaches.
Basically I want to know if there is a portal open for a given id:
Basically I tried to do the same with a computed property and the service, but it requires setting up dynamic CPs (since I'm using the id) which is way too much work if you have multiple portals.
I'm trying to use ember-portal to render some content in another component outside of the current hierarchy, however the content isn't being rendered.
Is it possible to have a {{portal-for}}
in a component and define the content for that portal in a different component?
See my example here https://github.com/knownasilya/ember-yielded-portals
In the drawbacks section I mention that the last use of the same portal will be the only one rendered. Is there a way we could append additional ones instead of replacing?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.