From 04a0e2ea87422585763cc4645ae5e4b852ae7966 Mon Sep 17 00:00:00 2001 From: Sanj Date: Fri, 21 Oct 2011 00:58:22 +0100 Subject: [PATCH] boxes going crazy after page move --- edgware/static/js/editor.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/edgware/static/js/editor.js b/edgware/static/js/editor.js index 9f4be48..9315191 100644 --- a/edgware/static/js/editor.js +++ b/edgware/static/js/editor.js @@ -279,7 +279,7 @@ Canvas.prototype.init = function() { } var html = tmpl("tmpl_canvas", json); this.parent.append(html); - this.jq = $('#' + 'canvas' + that.index.toString()); + this.jq = $('#' + 'canvas' + that.index.toString()).data("canvas", that); this.jq.css({'height': heightPx, 'width': widthPx}); this.jq.find('.ruler_vert').draggable({ snap: '.box', @@ -294,7 +294,8 @@ Canvas.prototype.init = function() { this.jq.droppable({accept:'.resource, .newTextBox', drop: function(ev, ui) { var box = $(this).getBox().jq; - c = edgeArticle[$(this).attr('data-index')]; +// c = edgeArticle[$(this).attr('data-index')]; + c = $(this).data("canvas"); if ($(ui.draggable).attr('class') == 'resource ui-draggable') { r = edgeBin.allResources[$(ui.draggable).attr("data-index")]; if (r.mime == 'image') {