Fixes some issues with merge changes.

This commit is contained in:
Shannon
2013-06-10 13:39:44 -02:00
parent 966531bd95
commit 81f10b72d7
3 changed files with 23 additions and 22 deletions

View File

@@ -1,16 +1,15 @@
/**
* @ngdoc filter
* @name umbraco.filters:umbTreeIconClass
* @restrict E
* @description This will properly render the tree icon class based on the tree icon set on the server
**/
function treeIconClassFilter() {
function treeIconClassFilter(treeIconHelper) {
return function (treeNode, standardClasses) {
if (treeNode.iconIsClass) {
return standardClasses + " " + treeNode.icon;
return standardClasses + " " + treeIconHelper.convertFromLegacy(treeNode);
}
return standardClasses;
//we need an 'icon-' class in there for certain styles to work so if it is image based we'll add this
return standardClasses + " icon-custom-file";
};
}
angular.module('umbraco.filters').filter("umbTreeIconClass", treeIconClassFilter);

View File

@@ -1,17 +0,0 @@
/**
* @ngdoc filter
* @name umbraco.filters:umbTreeIconImage
* @restrict E
* @description This will properly render the tree icon image based on the tree icon set on the server
**/
function treeIconImageFilter() {
return function (treeNode) {
if (treeNode.iconIsClass) {
return "";
}
return "<img src='" + treeNode.iconFilePath + "'></img>";
};
}
//angular.module('umbraco.filters').filter("umbTreeIconImage", treeIconImageFilter);

View File

@@ -0,0 +1,19 @@
/**
* @ngdoc filter
* @name umbraco.filters:umbTreeIconImage
* @description This will properly render the tree icon image based on the tree icon set on the server
**/
function treeIconStyleFilter(treeIconHelper) {
return function (treeNode) {
if (treeNode.iconIsClass) {
var converted = treeIconHelper.convertFromLegacy(treeNode);
if (converted.startsWith('.')) {
//its legacy so add some width/height
return "height:16px;width:16px;";
}
return "";
}
return "background-image: url('" + treeNode.iconFilePath + "');height:16px;background-position:2px 0px";
};
}
angular.module('umbraco.filters').filter("umbTreeIconStyle", treeIconStyleFilter);