From cadee171fcfc9e12cb7b5faa9b333657698597bf Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Mon, 22 Feb 2016 02:09:03 +0300 Subject: [PATCH] - backgroundPicture directive --- src/client/app.js | 1 - src/client/directives/backgroundPicture.js | 26 ---------------------- 2 files changed, 27 deletions(-) delete mode 100644 src/client/directives/backgroundPicture.js diff --git a/src/client/app.js b/src/client/app.js index 73bd4f02..76f8d688 100644 --- a/src/client/app.js +++ b/src/client/app.js @@ -92,7 +92,6 @@ app.run(($location, $rootScope, $http) => { api, IOService, MenuService, - require('./directives/backgroundPicture'), require('./ui/breadcrumbs'), require('./ui/timeline'), require('./filters/strip'), diff --git a/src/client/directives/backgroundPicture.js b/src/client/directives/backgroundPicture.js deleted file mode 100644 index 46cb5b58..00000000 --- a/src/client/directives/backgroundPicture.js +++ /dev/null @@ -1,26 +0,0 @@ -module.exports = function (app) { - app.directive('backgroundPicture', function () { - return { - restrict: 'E', - template: '
', - scope: { - src: '=' - }, - link: function($scope, $element){ - var element = $element.find('.background-picture').get(0); - element.style.backgroundImage = `url('${$scope.src}')`; - - setTimeout(function () { - var w = element.offsetWidth; - var h = element.offsetHeight; - - if (w > h) { - element.classList.add('horizontal'); - } else { - element.classList.add('vertical'); - } - }, 100); - } - } - }); -}; \ No newline at end of file