This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"lastUpload":"2021-03-29T07:01:18.324Z","extensionVersion":"v3.4.3"} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This service and directive are a complete system of drag'n drop. This system drag and drop not only the html element | |
//but also the data of the ngModel where the draggable directive is added in the droppable ngModel | |
//The service is use to share the data between the two directives (draggable, droppable) | |
angular.module('dragndropServices', []).factory('dragndropService', function($rootScope) { | |
dragndropService = { | |
draggedData : {}, | |
setDraggedData : function(data){ | |
this.draggedData = data; | |
}, | |
getDraggedData : function(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Edit from http://blog.vjeux.com/2013/javascript/scroll-position-with-react.html | |
componentDidMount() { | |
const node = ReactDOM.findDOMNode(this); | |
node.scrollTop = node.scrollHeight; | |
} | |
componentWillUpdate: function() { | |
const node = this.getDOMNode(); | |
this.shouldScrollBottom = node.scrollTop + node.offsetHeight === node.scrollHeight; | |
}, |