Switched to using the jquery-dragster library to implement more consistent drag and drop support, rather than using the inconsistent html5 implementation

Этот коммит содержится в:
Reed Garmsen
2015-08-11 11:42:31 -07:00
родитель 9baafdb372
Коммит 9f9d93e613
6 изменённых файлов: 172 добавлений и 26 удалений

Просмотреть файл

@@ -113,34 +113,30 @@ module.exports = React.createClass({
var self = this;
if (this.props.postType === 'post') {
$('body').on('dragover dragleave', '.app__content', function(e) {
e.preventDefault();
});
$('body').on('dragenter', '.app__content', function(e) {
e.preventDefault();
console.log('HERE');
$('.app__content').addClass('center-file-overlay');
$('.post-right__container').removeClass('right-file-overlay');
});
$('body').on('drop', '.app__content', function(e) {
e.preventDefault();
$('.app__content').removeClass('center-file-overlay');
self.handleDrop(e);
$('.app__content').dragster({
enter: function(dragsterEvent, e) {
$('.app__content').addClass('center-file-overlay');
},
leave: function(dragsterEvent, e) {
$('.app__content').removeClass('center-file-overlay');
},
drop: function(dragsterEvent, e) {
$('.app__content').removeClass('center-file-overlay');
self.handleDrop(e);
}
});
} else if (this.props.postType === 'comment') {
$('body').on('dragover dragleave', '.post-right__container', function(e) {
e.preventDefault();
});
$('body').on('dragenter', '.post-right__container', function(e) {
e.preventDefault();
console.log('HERE RIGHT');
$('.post-right__container').addClass('right-file-overlay');
$('.app__content').removeClass('center-file-overlay');
});
$('body').on('drop', '.post-right__container', function(e) {
e.preventDefault();
$('.post-right__container').removeClass('right-file-overlay');
self.handleDrop(e);
$('.post-right__container').dragster({
enter: function(dragsterEvent, e) {
$('.post-right__container').addClass('right-file-overlay');
},
leave: function(dragsterEvent, e) {
$('.post-right__container').removeClass('right-file-overlay');
},
drop: function(dragsterEvent, e) {
$('.post-right__container').removeClass('right-file-overlay');
self.handleDrop(e);
}
});
}