Code Monkey home page Code Monkey logo

ember-portal's People

Contributors

csantero avatar ember-tomster avatar rlivsey avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

ember-portal's Issues

Consider add portal-tag-name support to PortForComponent

The Proposition

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;
},

The Reason

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

Importing from the `ember-component` module has been deprecated.

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.

component naming

-content and -for don't immediately resonate with which side of the wormhole is represented.
how about something like portal-input and portal-output ?

Using a custom `.render` function is no longer supported.

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.

Parent template's contents rendering in wormhole when app is launched from child route

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.

Knowing if there is a portal open

Basically I want to know if there is a portal open for a given id:

{{#with (concat 'footer-' elementId) as |portalName|}}
  {{#if (portal-open portalName)}}
    {{portal-for name=portalName}}
  {{/if}}
{{/with}}

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.

Portal from one component to another

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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.