diff options
Diffstat (limited to 'js/panels/css-panel/style.reel/style.js')
-rw-r--r-- | js/panels/css-panel/style.reel/style.js | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/js/panels/css-panel/style.reel/style.js b/js/panels/css-panel/style.reel/style.js index 6ff102b2..c3e9efdf 100644 --- a/js/panels/css-panel/style.reel/style.js +++ b/js/panels/css-panel/style.reel/style.js | |||
@@ -28,7 +28,36 @@ exports.Style = Montage.create(TreeNode, { | |||
28 | this.needsDraw = true; | 28 | this.needsDraw = true; |
29 | } | 29 | } |
30 | }, | 30 | }, |
31 | handleEvent : { | ||
32 | value: function(e) { | ||
33 | console.log(e); | ||
34 | } | ||
35 | }, | ||
36 | |||
37 | handleDragstart : { | ||
38 | value: function(e) { | ||
39 | e.dataTransfer.effectAllowed = 'move'; | ||
40 | e.dataTransfer.setData('Text', 'my styles, baby!'); | ||
41 | this.element.classList.add("dragged"); | ||
42 | } | ||
43 | }, | ||
31 | 44 | ||
45 | handleDragend : { | ||
46 | value: function(e) { | ||
47 | this.element.classList.remove("dragging"); | ||
48 | this.element.classList.remove("dragged"); | ||
49 | } | ||
50 | }, | ||
51 | handleDrag : { | ||
52 | value: function(e) { | ||
53 | this.element.classList.add("dragging"); | ||
54 | } | ||
55 | }, | ||
56 | handleDrop : { | ||
57 | value: function(e) { | ||
58 | this.element.classList.remove("drag-enter"); | ||
59 | } | ||
60 | }, | ||
32 | handleSourceObjectSet: { | 61 | handleSourceObjectSet: { |
33 | value: function() { | 62 | value: function() { |
34 | //debugger; | 63 | //debugger; |
@@ -41,7 +70,17 @@ exports.Style = Montage.create(TreeNode, { | |||
41 | console.log("style - template did load"); | 70 | console.log("style - template did load"); |
42 | } | 71 | } |
43 | }, | 72 | }, |
44 | 73 | prepareForDraw : { | |
74 | value: function() { | ||
75 | console.log("style's prepare for draw"); | ||
76 | this.element.addEventListener('dragstart', this, false); | ||
77 | this.element.addEventListener('drag', this, false); | ||
78 | // this.element.addEventListener('dragenter', this, false); | ||
79 | // this.element.addEventListener('dragleave', this, false); | ||
80 | this.element.addEventListener('dragend', this, false); | ||
81 | this.element.addEventListener('drop', this, false); | ||
82 | } | ||
83 | }, | ||
45 | draw : { | 84 | draw : { |
46 | value : function() { | 85 | value : function() { |
47 | //debugger; | 86 | //debugger; |