aboutsummaryrefslogtreecommitdiffstats
path: root/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js
diff options
context:
space:
mode:
authortalasila <talasila@research.att.com>2017-02-08 10:13:29 -0500
committertalasila <talasila@research.att.com>2017-02-08 10:15:00 -0500
commitf8a8d5192b1e5013d9e2f699be54b072ef39d5f0 (patch)
treeb7a65bb0a7d70a9dc24c064113868e5f3b8e6a09 /dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js
parent72a80fbff7120630576ccd5aa67c20818c2943c7 (diff)
Initial OpenECOMP UI/DMaapBC commit
Change-Id: Ia492e1b88311b9bed4c31f593b28deaaad73b7e4 Signed-off-by: talasila <talasila@research.att.com>
Diffstat (limited to 'dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js')
-rw-r--r--dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js
new file mode 100644
index 0000000..ae95580
--- /dev/null
+++ b/dcae_dmaapbc_webapp/src/main/webapp/app/fusion/ase/scripts/dragMoveListenerArrow.js
@@ -0,0 +1,44 @@
+/*
+=============================================================================================
+The MIT License (MIT)
+
+Copyright 2015 AT&T Intellectual Property. All other rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+*/
+
+//Called when an arrow is moved, translates the arrow and updates attributes
+
+x = 0, y = 0; //Define coordinates
+
+function dragMoveListenerArrow (event) {
+ var target = event.target,
+ uuid = target.id,
+ // keep the dragged position in the data-x/data-y attributes
+ x = (parseFloat(target.getAttribute('data_x')) || 0) + event.dx,
+ y = (parseFloat(target.getAttribute('data_y')) || 0) + event.dy;
+
+ // translate the element
+ target.style.webkitTransform =
+ target.style.transform =
+ 'translate(' + x + 'px, ' + y + 'px)';
+
+ // update the position attributes
+ target.setAttribute('data_x', x);
+ target.setAttribute('data_y', y);
+
+ if ($("#"+uuid).hasClass("arrowDraggable")){
+ storeXY(arrowArr,uuid);
+ }
+ if ($("#"+uuid).hasClass("note")){
+ storeXY(noteArr,uuid);
+ }
+
+}
+
+// this is used in resizing
+window.dragMoveListenerArrow = dragMoveListenerArrow; \ No newline at end of file