diff options
Diffstat (limited to 'js/panels/Timeline/Layer.reel')
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.html | 36 | ||||
-rw-r--r-- | js/panels/Timeline/Layer.reel/Layer.js | 22 |
2 files changed, 47 insertions, 11 deletions
diff --git a/js/panels/Timeline/Layer.reel/Layer.html b/js/panels/Timeline/Layer.reel/Layer.html index 79b522ee..ef98bdd5 100644 --- a/js/panels/Timeline/Layer.reel/Layer.html +++ b/js/panels/Timeline/Layer.reel/Layer.html | |||
@@ -22,7 +22,8 @@ | |||
22 | "positionCollapser" : {"@" : "positionCollapser"}, | 22 | "positionCollapser" : {"@" : "positionCollapser"}, |
23 | "transformCollapser" : {"@" : "transformCollapser"}, | 23 | "transformCollapser" : {"@" : "transformCollapser"}, |
24 | "styleCollapser" : {"@" : "styleCollapser"}, | 24 | "styleCollapser" : {"@" : "styleCollapser"}, |
25 | "clickerMain" : {"#" : "clicker-main"} | 25 | "clickerMain" : {"#" : "clicker-main"}, |
26 | "myLabel" : {"#" : "myLabel"} | ||
26 | } | 27 | } |
27 | }, | 28 | }, |
28 | "dtext1" : { | 29 | "dtext1" : { |
@@ -301,7 +302,7 @@ | |||
301 | "properties" : { | 302 | "properties" : { |
302 | "element" : {"#" : "content-style"}, | 303 | "element" : {"#" : "content-style"}, |
303 | "myContent" : {"#":"content-style"}, | 304 | "myContent" : {"#":"content-style"}, |
304 | "contentHeight" : 60, | 305 | "contentHeight" : 0, |
305 | "isLabelClickable" : true, | 306 | "isLabelClickable" : true, |
306 | "clicker" : {"#" : "clicker-style"}, | 307 | "clicker" : {"#" : "clicker-style"}, |
307 | "isCollapsed" : true, | 308 | "isCollapsed" : true, |
@@ -314,7 +315,34 @@ | |||
314 | "oneway" : false | 315 | "oneway" : false |
315 | } | 316 | } |
316 | } | 317 | } |
317 | } | 318 | }, |
319 | |||
320 | "DragDrop": { | ||
321 | "module": "js/panels/Timeline/DragDrop.js", | ||
322 | "name": "DragDropComposer", | ||
323 | "properties": { | ||
324 | "element": {"#": "myLabel"}, | ||
325 | "component": {"@": "owner"} | ||
326 | }, | ||
327 | "listeners": [ | ||
328 | { | ||
329 | "type": "dragStart", | ||
330 | "listener": {"@": "owner"} | ||
331 | }, | ||
332 | { | ||
333 | "type": "dropHover", | ||
334 | "listener": {"@": "owner"} | ||
335 | }, | ||
336 | { | ||
337 | "type": "dropped", | ||
338 | "listener": {"@": "owner"} | ||
339 | }, | ||
340 | { | ||
341 | "type": "dropEnd", | ||
342 | "listener": {"@": "owner"} | ||
343 | } | ||
344 | ] | ||
345 | } | ||
318 | 346 | ||
319 | 347 | ||
320 | } | 348 | } |
@@ -323,7 +351,7 @@ | |||
323 | <body> | 351 | <body> |
324 | 352 | ||
325 | <div data-montage-id="layer" class="container-layer"> | 353 | <div data-montage-id="layer" class="container-layer"> |
326 | <div class="label-layer"> | 354 | <div class="label-layer" data-montage-id="myLabel"> |
327 | <span class="collapsible-label" data-montage-id="layer-label-text" spellcheck="false">Label</span> | 355 | <span class="collapsible-label" data-montage-id="layer-label-text" spellcheck="false">Label</span> |
328 | <span class="collapsible-clicker collapsible-collapsed" data-montage-id="clicker-main"></span> | 356 | <span class="collapsible-clicker collapsible-collapsed" data-montage-id="clicker-main"></span> |
329 | <div class="cssbutton button-lock"></div> | 357 | <div class="cssbutton button-lock"></div> |
diff --git a/js/panels/Timeline/Layer.reel/Layer.js b/js/panels/Timeline/Layer.reel/Layer.js index 238ddae9..bddfcd3e 100644 --- a/js/panels/Timeline/Layer.reel/Layer.js +++ b/js/panels/Timeline/Layer.reel/Layer.js | |||
@@ -499,15 +499,15 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
499 | 499 | ||
500 | 500 | ||
501 | // Add event listeners to add and delete style buttons | 501 | // Add event listeners to add and delete style buttons |
502 | this.buttonAddStyle.identifier = "addStyle"; | 502 | this.buttonAddStyle.addEventListener("click", this.handleAddStyleClick.bind(this), false); |
503 | this.buttonAddStyle.addEventListener("click", this, false); | 503 | this.buttonDeleteStyle.addEventListener("click", this.handleDeleteStyleClick.bind(this), false); |
504 | |||
505 | this.buttonDeleteStyle.identifier = "deleteStyle"; | ||
506 | this.buttonDeleteStyle.addEventListener("click", this, false); | ||
507 | 504 | ||
508 | // Add mousedown listener to set isActive | 505 | // Add mousedown listener to set isActive |
509 | this.element.addEventListener("mousedown", this, false); | 506 | this.element.addEventListener("mousedown", this, false); |
510 | this.element.addEventListener("click", this, false); | 507 | this.element.addEventListener("click", this, false); |
508 | |||
509 | // Drag and drop event hanlders | ||
510 | this.element.addEventListener("dropped", this, false); | ||
511 | 511 | ||
512 | } | 512 | } |
513 | }, | 513 | }, |
@@ -574,6 +574,8 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
574 | newEvent = document.createEvent("CustomEvent"); | 574 | newEvent = document.createEvent("CustomEvent"); |
575 | 575 | ||
576 | this.isStyleCollapsed = false; | 576 | this.isStyleCollapsed = false; |
577 | this.layerData.isStyleCollapsed = false; | ||
578 | this.triggerOutgoingBinding(); | ||
577 | 579 | ||
578 | newEvent.initCustomEvent("layerEvent", false, true); | 580 | newEvent.initCustomEvent("layerEvent", false, true); |
579 | newEvent.layerEventLocale = "styles"; | 581 | newEvent.layerEventLocale = "styles"; |
@@ -604,7 +606,8 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
604 | // Set up the event info and dispatch the event | 606 | // Set up the event info and dispatch the event |
605 | 607 | ||
606 | newEvent.styleSelection = mySelection; | 608 | newEvent.styleSelection = mySelection; |
607 | //defaultEventManager.dispatchEvent(newEvent); | 609 | defaultEventManager.dispatchEvent(newEvent); |
610 | |||
608 | 611 | ||
609 | } | 612 | } |
610 | }, | 613 | }, |
@@ -624,7 +627,7 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
624 | newEvent.layerID = this.layerID; | 627 | newEvent.layerID = this.layerID; |
625 | newEvent.styleID = this.arrLayerStyles[selectedIndex].styleID; | 628 | newEvent.styleID = this.arrLayerStyles[selectedIndex].styleID; |
626 | newEvent.styleSelection = selectedIndex; | 629 | newEvent.styleSelection = selectedIndex; |
627 | //defaultEventManager.dispatchEvent(newEvent); | 630 | defaultEventManager.dispatchEvent(newEvent); |
628 | 631 | ||
629 | // Delete the style from the view | 632 | // Delete the style from the view |
630 | this.arrLayerStyles.splice(selectedIndex, 1); | 633 | this.arrLayerStyles.splice(selectedIndex, 1); |
@@ -783,6 +786,11 @@ var Layer = exports.Layer = Montage.create(Component, { | |||
783 | this.triggerOutgoingBinding(); | 786 | this.triggerOutgoingBinding(); |
784 | } | 787 | } |
785 | }, | 788 | }, |
789 | handleDropped : { | ||
790 | value: function(event) { | ||
791 | console.log('wheeee! WWEWWEWWWWEEEEEEEEE') | ||
792 | } | ||
793 | }, | ||
786 | /* End: Event handlers */ | 794 | /* End: Event handlers */ |
787 | 795 | ||
788 | /* Begin: Logging routines */ | 796 | /* Begin: Logging routines */ |