(function () {
	'use strict';

    var ng_module_name = 'tile_library';

	angular.module(ng_module_name)
		.directive('tileInsertLocation', tileInsertLocation);

	function tileInsertLocation()
	{
		return {
			link: link,
			replace: false,
			restrict: 'E',
			scope: {
				store: '='
			}
		};

		function link(scope, iElement)
		{
			var elem = angular.element(iElement).closest('.js-insert-target');
			scope.store.x = elem.data('x');
			scope.store.y = elem.data('y');
		}
	}
}());