From 34c1602cdac35bda5edfbf7882f4cdcd9d7ffda3 Mon Sep 17 00:00:00 2001 From: fencliff Date: Wed, 16 Jan 2013 03:03:53 +0200 Subject: [PATCH] fix drag&drop issue in winedetails view (chrome bug #168387) --- public/js/views/winedetails.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/public/js/views/winedetails.js b/public/js/views/winedetails.js index 560802d..6075ce6 100644 --- a/public/js/views/winedetails.js +++ b/public/js/views/winedetails.js @@ -10,10 +10,11 @@ window.WineView = Backbone.View.extend({ }, events: { - "change" : "change", - "click .save" : "beforeSave", - "click .delete" : "deleteWine", - "drop #picture" : "dropHandler" + "change" : "change", + "click .save" : "beforeSave", + "click .delete" : "deleteWine", + "drop #picture" : "dropHandler", + "dragover #picture" : "dragoverHandler" }, change: function (event) { @@ -84,6 +85,10 @@ window.WineView = Backbone.View.extend({ $('#picture').attr('src', reader.result); }; reader.readAsDataURL(this.pictureFile); + }, + + dragoverHandler: function(event) { + event.preventDefault(); } }); \ No newline at end of file