Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9134873
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:44:29+00:00 2026-06-17T08:44:29+00:00

I was happily coding and learning backbone when this #~@@! happened! I use require

  • 0

I was happily coding and learning backbone when this #~@@! happened!

I use require to separate my views from models, etc.

In my Backbone view I handle this events:

define(['...'],function(...) {

var DishView = Backbone.View.extend({
    template: _.template(dish),
    tagName: 'div',
    id: 'dish',

    initialize: function() {
        console.log('initializing dishView');
        this.model.on('change', this.render, this);
    },

    render: function(){
        console.log('rendering dishView');
        this.$el.html(this.template(this.model.toJSON()));
        return this;
    },

    events: {
        'click #relations-menu .newItem': 'launch_modal_relations',
        'click #delete' : 'delete_dish',
        'click #save-basic-changes': 'save_basic',
        'drop #dropPicture' : 'dropHandler',
        'dragenter #dropPicture' : 'alertMe'
    },

    alertMe: function () {
        console.log('clicked on image');
    },

    delete_dish: function () {
        this.model.deleteMyself();
        Backbone.history.navigate('/', {trigger: true});
    },

    save_basic: function (event) {
        var name = $('#inputName').val();
        var description = $('#inputDescription').val();
        var price = $('#inputPrice').val();
        this.model.updateBasicInfo(name, description, price);
    },

    dropHandler: function(event) {
        event.preventDefault();
        console.log('drop received');
        event.stopPropagation();

        var e = event.originalEvent;
        e.dataTransfer.dropEffect = 'copy';
        this.pictureFile = e.dataTransfer.files[0];
            ...

    },
return DishView;

});

My drag&drop was working and suddenly when a lot of more functionality was added, it stopped working 🙁 the image file it’s opened in the browser.

I’ve read about the DOM being ready and that this can happen sometimes (if the code gets evaluated when the DOM is ready) but the click events still get fired, also the dragenter event….

Could this be some typo?? I’m going a little bit crazy I can’t understand whats going on and can’t remember a good commit to go back and check :S

Thank you all if you can show some possible answers 🙂

For example:
– how can I debug the drop event???
– how can I know if an event is tied to my view?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T08:44:31+00:00Added an answer on June 17, 2026 at 8:44 am

    You’re not crazy. A recent update in Google Chrome broke the drop-into-browser feature for a lot of sites, including, it seems, the NodeCellar tutorial.
    This is quite easily fixable, though. Chrome now requires you to prevent the default action for the dragover event:

    $('div').on('drop',function(e){
        e.originalEvent.stopPropagation();
        e.originalEvent.preventDefault();
        $(this).html('A file was dropped!');
    }).on('dragover', function (e) {
      e.preventDefault();
    });
    

    This JSFiddle demo works for me (Chrome 24.0.1312.52). Here’s the Chromium issue #168387, about this problem.

    And a pull request to fix this in NodeCellar.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I was happily using VS2010 Premium version for a C/C++ coding project, and needed
I have: public static int[] ArrayWorkings() I can call it happily with MyClass.ArrayWorkings() from
an svn:externals reference like this dojo -r 21434 http://svn.dojotoolkit.org/src/dojo/trunk/ is happily accepted by subversive
I had been happily coding along on a decent sized solution (just over 13k
Until a week ago I was happily coding html.erb files in Notepad++ with syntax
I have this macro running happily on a live server. It was ok in
I'm happily in the middle of coding then I try to launch my app
I was happily working with HSQLDB by just having my DB URL like this:
I am happily launching a program in a windows system from Lua using strProgram
I was happily coding, thinking I'd not run into problems anymore (for now, at

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.