Giter VIP home page Giter VIP logo

Comments (6)

kmiyashiro avatar kmiyashiro commented on August 20, 2024

Yes, it seems that you are actually overriding the hooks instead of adding event listeners. Maybe adding properties like onaddedfile etc for adding event listeners to dropzone events would work. I think this problem is compounded by the fact that access to the Dropzone instance is impossible by actions unless you extend the component.

from ember-cli-dropzonejs.

FutoRicky avatar FutoRicky commented on August 20, 2024

I am having trouble understanding the issue. How would I go to recreate this problem?

Also, @kkamkou try assigning a function property instead of an action to the complete attribute.

from ember-cli-dropzonejs.

kkamkou avatar kkamkou commented on August 20, 2024

try assigning a function property instead of an action

It doesn't matter. In the variant you propose me, I lose the context of the callback. And it won't fix the problem.

Yes, it seems that you are actually overriding the hooks instead of adding event listeners.

true

I am having trouble understanding the issue.

I see it from the code. All you need to do (in case you want to fix it) is to register events like events and not like an attribute. forEach() if (this.complete is function) {dropzone.on('complete', this.complete)}

from ember-cli-dropzonejs.

FutoRicky avatar FutoRicky commented on August 20, 2024

@kkamkou oohh yes I see. Thanks for pointing this out. Will definitely fix this.

from ember-cli-dropzonejs.

FutoRicky avatar FutoRicky commented on August 20, 2024

Fixed the event handling logic 7eb7b33.

Declare the event function in controller for example:

addedFileEvent: Ember.computed(function() {
  return function() {
    // do something...
  };
}),

Declare component

{{drop-zone url=http://example.com addfile=addedFileEvent}}

You can update to version 0.7.0 to have this fix

from ember-cli-dropzonejs.

kkamkou avatar kkamkou commented on August 20, 2024

It works, thank you.

from ember-cli-dropzonejs.

Related Issues (20)

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.