1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- 'use strict';
- /**
- * Licensed Materials - Property of IBM
- * IBM Cognos Products: BI Cloud (C) Copyright IBM Corp. 2013, 2019
- * US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
- */
- define(['./Move', 'jquery'], function (BaseMoveClass, $) {
- var Move = null;
- Move = BaseMoveClass.extend({
- init: function init() {
- Move.inherited('init', this, arguments);
- },
- getDragDataType: function getDragDataType() {
- return 'groupContent';
- },
- handleDrop: function handleDrop() /*dropContext*/{
- var $n, nodeInfo;
- var positionUpdateArray = [];
- for (var i = 0, iLen = this.dropInfo.nodeInfoList.length; i < iLen; i++) {
- // get node from info list
- nodeInfo = this.dropInfo.nodeInfoList[i];
- $n = $(nodeInfo.node);
- // if layout then update model
- if (nodeInfo.node._layout) {
- nodeInfo.dropPosition = {
- x: parseInt($n.css('left'), 10),
- y: parseInt($n.css('top'), 10)
- };
- var positionUpdate = nodeInfo.node._layout.parentLayout.getWidgetPositionUpdate(nodeInfo);
- // setup position info array to pass to model
- positionUpdateArray.push(positionUpdate);
- }
- }
- var transactionApi = this.dashboardApi.getFeature('Transaction');
- var transactionToken = transactionApi.startTransaction();
- this.updateModel(positionUpdateArray, transactionToken);
- this.emit('moveGroupContent:done', { 'currentSelection': this.selectedNodes, undoRedoTransactionId: transactionToken.transactionId, transactionToken: transactionToken });
- transactionApi.endTransaction(transactionToken);
- }
- });
- return Move;
- });
- //# sourceMappingURL=MoveGroupContent.js.map
|