newscoop/JS-Scoopwriter

View on GitHub
app/scripts/directives/fixed-image-placeholder.js

Summary

Maintainability
A
0 mins
Test Coverage
'use strict';

angular.module('authoringEnvironmentApp').directive('fixedImagePlaceholder',
    function () {
        return {
            templateUrl: 'views/fixed-image-placeholder.html',
            restrict: 'E',
            link: function postLink(scope, element, attrs) {
                element.on('drop', function (e) {
                    e.preventDefault();
                    var data = e.originalEvent.dataTransfer.getData('Text');
                    scope.onDrop(data);
                });
            }
        };
    }
);