From 5ab978ecf51b2ae2e3dbb4c96a8187adcaceb40d Mon Sep 17 00:00:00 2001 From: Mads Rasmussen Date: Thu, 9 Aug 2018 20:29:17 +0200 Subject: [PATCH] remove umb-photo-folder --- .../_obsolete/umbphotofolder.directive.js | 70 ----------- .../src/less/property-editors.less | 117 ------------------ .../_obsolete/umb-photo-folder.html | 28 ----- 3 files changed, 215 deletions(-) delete mode 100644 src/Umbraco.Web.UI.Client/src/common/directives/_obsolete/umbphotofolder.directive.js delete mode 100644 src/Umbraco.Web.UI.Client/src/views/directives/_obsolete/umb-photo-folder.html diff --git a/src/Umbraco.Web.UI.Client/src/common/directives/_obsolete/umbphotofolder.directive.js b/src/Umbraco.Web.UI.Client/src/common/directives/_obsolete/umbphotofolder.directive.js deleted file mode 100644 index c6c628741f..0000000000 --- a/src/Umbraco.Web.UI.Client/src/common/directives/_obsolete/umbphotofolder.directive.js +++ /dev/null @@ -1,70 +0,0 @@ -/** -* @ngdoc directive -* @name umbraco.directives.directive:umbPhotoFolder -* @deprecated -* We plan to remove this directive in the next major version of umbraco (8.0). The directive is not recommended to use. -* @restrict E -**/ - -angular.module("umbraco.directives.html") - .directive('umbPhotoFolder', function($compile, $log, $timeout, $filter, umbPhotoFolderHelper) { - - return { - restrict: 'E', - replace: true, - require: '?ngModel', - terminate: true, - templateUrl: 'views/directives/_obsolete/umb-photo-folder.html', - link: function(scope, element, attrs, ngModel) { - - var lastWatch = null; - - ngModel.$render = function() { - if (ngModel.$modelValue) { - - $timeout(function() { - var photos = ngModel.$modelValue; - - scope.clickHandler = scope.$eval(element.attr('on-click')); - - - var imagesOnly = element.attr('images-only') === "true"; - - - var margin = element.attr('border') ? parseInt(element.attr('border'), 10) : 5; - var startingIndex = element.attr('baseline') ? parseInt(element.attr('baseline'), 10) : 0; - var minWidth = element.attr('min-width') ? parseInt(element.attr('min-width'), 10) : 420; - var minHeight = element.attr('min-height') ? parseInt(element.attr('min-height'), 10) : 100; - var maxHeight = element.attr('max-height') ? parseInt(element.attr('max-height'), 10) : 300; - var idealImgPerRow = element.attr('ideal-items-per-row') ? parseInt(element.attr('ideal-items-per-row'), 10) : 5; - var fixedRowWidth = Math.max(element.width(), minWidth); - - scope.containerStyle = { width: fixedRowWidth + "px" }; - scope.rows = umbPhotoFolderHelper.buildGrid(photos, fixedRowWidth, maxHeight, startingIndex, minHeight, idealImgPerRow, margin, imagesOnly); - - if (attrs.filterBy) { - - //we track the watches that we create, we don't want to create multiple, so clear it - // if it already exists before creating another. - if (lastWatch) { - lastWatch(); - } - - //TODO: Need to debounce this so it doesn't filter too often! - lastWatch = scope.$watch(attrs.filterBy, function (newVal, oldVal) { - if (newVal && newVal !== oldVal) { - var p = $filter('filter')(photos, newVal, false); - scope.baseline = 0; - var m = umbPhotoFolderHelper.buildGrid(p, fixedRowWidth, maxHeight, startingIndex, minHeight, idealImgPerRow, margin, imagesOnly); - scope.rows = m; - } - }); - } - - }, 500); //end timeout - } //end if modelValue - - }; //end $render - } - }; - }); diff --git a/src/Umbraco.Web.UI.Client/src/less/property-editors.less b/src/Umbraco.Web.UI.Client/src/less/property-editors.less index a9f6d3fbd4..d6cf651c48 100644 --- a/src/Umbraco.Web.UI.Client/src/less/property-editors.less +++ b/src/Umbraco.Web.UI.Client/src/less/property-editors.less @@ -668,123 +668,6 @@ ul.color-picker li { } - -// -// Photo folder styling -// -------------------------------------------------- - -.umb-photo-folder .picrow{ - overflow-y: hidden; - position: relative; -} - - - -.umb-photo-folder .picrow div, .umb-photo-preview{ - margin: 0px; - padding: 0px; - border: none; - display: inline-block; - vertical-align: top; - position: relative; -} - - - -.umb-photo-folder .picrow div a:first-child { - width:100%; - height:100%; -} - -.umb-photo-folder .picrow div.umb-photo { - width:100%; - height:100%; - background-color: @gray-10; -} - -.umb-photo-folder a:hover{text-decoration: none} -.umb-photo-folder .umb-non-thumbnail{ - text-align: center; - vertical-align: middle; - font-size: 12px; - background: @gray-10; - color: @black; - text-decoration: none; -} - -.umb-photo-folder .selector-overlay{ - display: none; -} - -//this is a temp hack, to provide selectors in the dialog: -.umb-photo-folder .pic:hover .selector-overlay { - position: absolute; - bottom: 0px; - left: 0px; - right: 0px; - padding: 5px; - background: @black; - z-index: 100; - display: block; - text-align: center; - color: @white; - opacity: 0.4; - text-decoration:none; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - -.umb-photo-folder .umb-non-thumbnail i{ - color: @gray-8; - font-size: 50px; - line-height: 60px; - display: block; - margin: auto; - /*vertically aligns */ - position: relative; - top: 50%; - transform: translateY(-50%); -} - -.umb-photo-folder .umb-non-thumbnail span{ - position: absolute; - display: block; - margin: auto; - width: 100%; - top: 20px; -} - -.umb-photo-folder .selected{ - position: relative; -} - -.umb-photo-folder .selected:before{ - content: "\e165"; - font-family: Icomoon; - - position: absolute; - bottom: 10px; - right: 10px; - - font-size: 24px; - color: @black; - opacity: 0.5; - background: @white; - - line-height: 36px; - text-align: center; - -moz-border-radius: 15px; - border-radius: 15px; - - height: 32px; - width: 32px; - overflow: hidden; - display: block; - z-index: 100; -} - - // // File upload // -------------------------------------------------- diff --git a/src/Umbraco.Web.UI.Client/src/views/directives/_obsolete/umb-photo-folder.html b/src/Umbraco.Web.UI.Client/src/views/directives/_obsolete/umb-photo-folder.html deleted file mode 100644 index 67e0ecbf66..0000000000 --- a/src/Umbraco.Web.UI.Client/src/views/directives/_obsolete/umb-photo-folder.html +++ /dev/null @@ -1,28 +0,0 @@ -
- -